Class: Azeroth::Decorator::MethodBuilder Private

Inherits:
Sinclair
  • Object
show all
Defined in:
lib/azeroth/decorator/method_builder.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Responsible for building readers for attributes

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build_reader(klass, attribute) ⇒ Array<Sinclair::MethodDefinition>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Builds reader

reaader delegate method calls to @object

Returns:

  • (Array<Sinclair::MethodDefinition>)


15
16
17
# File 'lib/azeroth/decorator/method_builder.rb', line 15

def self.build_reader(klass, attribute)
  new(klass).build_reader(attribute)
end

Instance Method Details

#build_reader(attribute) ⇒ Array<Sinclair::MethodDefinition>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Builds reader

reaader delegate method calls to @object

Returns:

  • (Array<Sinclair::MethodDefinition>)


20
21
22
23
# File 'lib/azeroth/decorator/method_builder.rb', line 20

def build_reader(attribute)
  add_method(attribute, "@object.#{attribute}")
  build
end