Class: MethodDecorator::Decoration

Inherits:
Object
  • Object
show all
Defined in:
lib/method_decorator/decoration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target_class, target_method_name, target_method) ⇒ Decoration

Returns a new instance of Decoration.


6
7
8
9
10
11
# File 'lib/method_decorator/decoration.rb', line 6

def initialize(target_class, target_method_name, target_method)
  self.target_class = target_class
  self.target_method_name = target_method_name
  self.target_method = target_method
  self.decoration = block_given? ? Proc.new : nil
end

Instance Attribute Details

#decorationObject

Returns the value of attribute decoration.


4
5
6
# File 'lib/method_decorator/decoration.rb', line 4

def decoration
  @decoration
end

#target_classObject

Returns the value of attribute target_class.


4
5
6
# File 'lib/method_decorator/decoration.rb', line 4

def target_class
  @target_class
end

#target_methodObject

Returns the value of attribute target_method.


4
5
6
# File 'lib/method_decorator/decoration.rb', line 4

def target_method
  @target_method
end

#target_method_nameObject

Returns the value of attribute target_method_name.


4
5
6
# File 'lib/method_decorator/decoration.rb', line 4

def target_method_name
  @target_method_name
end