Exception: MakeVoteable::Exceptions::AlreadyVotedError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(up_vote) ⇒ AlreadyVotedError

Returns a new instance of AlreadyVotedError.



6
7
8
9
10
11
12
13
14
# File 'lib/make_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

#up_voteObject (readonly)

Returns the value of attribute up_vote.



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

def up_vote
  @up_vote
end