Exception: RedisVoteable::Exceptions::AlreadyVotedError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/redis_voteable/exceptions.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (AlreadyVotedError) initialize(up_vote)



6
7
8
9
10
11
12
13
14
# File 'lib/redis_voteable/exceptions.rb', line 6

def initialize(up_vote)
  vote = if up_vote
    "up voted"
  else
    "down voted"
  end
    
  super "The voteable was already #{vote} by the voter."
end

Instance Attribute Details

- (Object) up_vote (readonly)

Returns the value of attribute up_vote



4
5
6
# File 'lib/redis_voteable/exceptions.rb', line 4

def up_vote
  @up_vote
end