Class: Tutor::Attributes::Blocks::Alias::Reader

Inherits:
Tutor::Attributes::Block show all
Defined in:
lib/tutor/attributes/blocks/alias/reader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject (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

#blockObject (readonly)

Returns the value of attribute block.



3
4
5
# File 'lib/tutor/attributes/blocks/alias/reader.rb', line 3

def block
  @block
end