Class: Tutor::Attributes::Blocks::Alias::Writer
- Inherits:
-
Tutor::Attributes::Block
- Object
- Tutor::Attributes::Block
- Tutor::Attributes::Blocks::Alias::Writer
- Defined in:
- lib/tutor/attributes/blocks/alias/writer.rb
Instance Attribute Summary collapse
-
#aliased_name ⇒ Object
readonly
Returns the value of attribute aliased_name.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
-
#initialize(aliased_name) ⇒ Writer
constructor
A new instance of Writer.
Constructor Details
#initialize(aliased_name) ⇒ Writer
Returns a new instance of Writer.
5 6 7 8 9 10 |
# File 'lib/tutor/attributes/blocks/alias/writer.rb', line 5 def initialize(aliased_name) self.tap do |block| @aliased_name = aliased_name super() { |object, value| object.send(block.aliased_name, value) } end end |
Instance Attribute Details
#aliased_name ⇒ Object (readonly)
Returns the value of attribute aliased_name.
3 4 5 |
# File 'lib/tutor/attributes/blocks/alias/writer.rb', line 3 def aliased_name @aliased_name end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
3 4 5 |
# File 'lib/tutor/attributes/blocks/alias/writer.rb', line 3 def block @block end |