Class: AttributeChanger::Committer
- Inherits:
-
Object
- Object
- AttributeChanger::Committer
- Defined in:
- lib/attribute_changer/committer.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#invalid_attribs ⇒ Object
readonly
Returns the value of attribute invalid_attribs.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #accept ⇒ Object
- #attrib_change ⇒ Object
-
#initialize(attribute_change) ⇒ Committer
constructor
A new instance of Committer.
- #reject ⇒ Object
Constructor Details
#initialize(attribute_change) ⇒ Committer
Returns a new instance of Committer.
4 5 6 7 |
# File 'lib/attribute_changer/committer.rb', line 4 def initialize(attribute_change) @result = AttributeChanger::Utils::Result.new nil, nil @attribute_change = attribute_change end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
2 3 4 |
# File 'lib/attribute_changer/committer.rb', line 2 def error @error end |
#invalid_attribs ⇒ Object (readonly)
Returns the value of attribute invalid_attribs.
2 3 4 |
# File 'lib/attribute_changer/committer.rb', line 2 def invalid_attribs @invalid_attribs end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
2 3 4 |
# File 'lib/attribute_changer/committer.rb', line 2 def result @result end |
Instance Method Details
#accept ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/attribute_changer/committer.rb', line 11 def accept if update_obj @result.success = true else @result.success = false false end end |
#attrib_change ⇒ Object
9 |
# File 'lib/attribute_changer/committer.rb', line 9 def attrib_change; @attribute_change end |
#reject ⇒ Object
20 21 22 |
# File 'lib/attribute_changer/committer.rb', line 20 def reject update_status :rejected end |