Class: BallotBox::Strategies::Base
- Inherits:
-
Object
- Object
- BallotBox::Strategies::Base
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/ballot_box/strategies/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#request ⇒ Object
Returns the value of attribute request.
-
#vote ⇒ Object
Returns the value of attribute vote.
-
#voteable ⇒ Object
Returns the value of attribute voteable.
Instance Method Summary collapse
-
#errors ⇒ Object
Returns the Errors object that holds all information about attribute error messages.
-
#initialize(voteable, vote) ⇒ Base
constructor
A new instance of Base.
- #read_attribute_for_validation(key) ⇒ Object
Constructor Details
#initialize(voteable, vote) ⇒ Base
Returns a new instance of Base.
10 11 12 13 14 |
# File 'lib/ballot_box/strategies/base.rb', line 10 def initialize(voteable, vote) @voteable = voteable @vote = vote @request = vote.request end |
Instance Attribute Details
#request ⇒ Object
Returns the value of attribute request.
8 9 10 |
# File 'lib/ballot_box/strategies/base.rb', line 8 def request @request end |
#vote ⇒ Object
Returns the value of attribute vote.
8 9 10 |
# File 'lib/ballot_box/strategies/base.rb', line 8 def vote @vote end |
#voteable ⇒ Object
Returns the value of attribute voteable.
8 9 10 |
# File 'lib/ballot_box/strategies/base.rb', line 8 def voteable @voteable end |
Instance Method Details
#errors ⇒ Object
Returns the Errors object that holds all information about attribute error messages.
21 22 23 |
# File 'lib/ballot_box/strategies/base.rb', line 21 def errors @vote.errors end |
#read_attribute_for_validation(key) ⇒ Object
16 17 18 |
# File 'lib/ballot_box/strategies/base.rb', line 16 def read_attribute_for_validation(key) @vote[key] end |