Class: Fried::Schema::SetAttribute
- Inherits:
-
Object
- Object
- Fried::Schema::SetAttribute
- Defined in:
- lib/fried/schema/set_attribute.rb
Overview
Set attribute value on object
Class Method Summary collapse
Instance Method Summary collapse
-
#call(obj, attribute, value) ⇒ Object
The passed value.
Class Method Details
.build ⇒ Object
6 7 8 |
# File 'lib/fried/schema/set_attribute.rb', line 6 def self.build new end |
.call(obj, attribute, value) ⇒ Object
10 11 12 13 |
# File 'lib/fried/schema/set_attribute.rb', line 10 def self.call(obj, attribute, value) instance = build instance.(obj, attribute, value) end |
Instance Method Details
#call(obj, attribute, value) ⇒ Object
Returns the passed value.
19 20 21 22 |
# File 'lib/fried/schema/set_attribute.rb', line 19 def call(obj, attribute, value) writer = attribute.writer obj.public_send(writer, value) end |