Class: Tutor::Attributes::Blocks::Alias::Reader
- Inherits:
-
Tutor::Attributes::Block
- Object
- Tutor::Attributes::Block
- Tutor::Attributes::Blocks::Alias::Reader
- Defined in:
- lib/tutor/attributes/blocks/alias/reader.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) ⇒ Reader
constructor
A new instance of Reader.
Constructor Details
#initialize(aliased_name) ⇒ Reader
Returns a new instance of Reader.
5 6 7 8 9 10 |
# File 'lib/tutor/attributes/blocks/alias/reader.rb', line 5 def initialize(aliased_name) self.tap do |block| @aliased_name = aliased_name super() { |object| object.send(block.aliased_name) } 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/reader.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/reader.rb', line 3 def block @block end |