Class: AttributeChanger::Performer
- Inherits:
-
Object
- Object
- AttributeChanger::Performer
- Defined in:
- lib/attribute_changer/performer.rb
Instance Attribute Summary collapse
-
#attrib ⇒ Object
readonly
Returns the value of attribute attrib.
-
#attrib_change ⇒ Object
readonly
Returns the value of attribute attrib_change.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#obj ⇒ Object
readonly
Returns the value of attribute obj.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(attribs) ⇒ Performer
constructor
A new instance of Performer.
- #save ⇒ Object
Constructor Details
#initialize(attribs) ⇒ Performer
Returns a new instance of Performer.
4 5 6 7 8 |
# File 'lib/attribute_changer/performer.rb', line 4 def initialize(attribs) @obj = attribs[:obj] @attrib = attribs[:attrib] @value = attribs[:value] end |
Instance Attribute Details
#attrib ⇒ Object (readonly)
Returns the value of attribute attrib.
2 3 4 |
# File 'lib/attribute_changer/performer.rb', line 2 def attrib @attrib end |
#attrib_change ⇒ Object (readonly)
Returns the value of attribute attrib_change.
2 3 4 |
# File 'lib/attribute_changer/performer.rb', line 2 def attrib_change @attrib_change end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
2 3 4 |
# File 'lib/attribute_changer/performer.rb', line 2 def error @error end |
#obj ⇒ Object (readonly)
Returns the value of attribute obj.
2 3 4 |
# File 'lib/attribute_changer/performer.rb', line 2 def obj @obj end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
2 3 4 |
# File 'lib/attribute_changer/performer.rb', line 2 def result @result end |
Instance Method Details
#save ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/attribute_changer/performer.rb', line 10 def save valid return false if result && !result.success create_attribute_change @result = AttributeChanger::Utils::Result.new true, nil true end |