Exception: VoterLove::Exceptions::AlreadyVotedError
- Inherits:
-
StandardError
- Object
- StandardError
- VoterLove::Exceptions::AlreadyVotedError
- Defined in:
- lib/voter_love/exceptions.rb
Instance Attribute Summary collapse
-
#up_vote ⇒ Object
readonly
Returns the value of attribute up_vote.
Instance Method Summary collapse
-
#initialize(up_vote) ⇒ AlreadyVotedError
constructor
A new instance of AlreadyVotedError.
Constructor Details
#initialize(up_vote) ⇒ AlreadyVotedError
Returns a new instance of AlreadyVotedError.
6 7 8 9 10 11 12 13 14 |
# File 'lib/voter_love/exceptions.rb', line 6 def initialize(up_vote) vote = if up_vote "up voted" else "down voted" end super "The votable was already #{vote} by the voter." end |
Instance Attribute Details
#up_vote ⇒ Object (readonly)
Returns the value of attribute up_vote.
4 5 6 |
# File 'lib/voter_love/exceptions.rb', line 4 def up_vote @up_vote end |