Class: MethodDecorator::Models::Decoration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, method_name, method_instance) ⇒ Decoration

Returns a new instance of Decoration.



10
11
12
13
14
15
16
# File 'lib/method_decorator/models/decoration.rb', line 10

def initialize(klass, method_name, method_instance)
  self.klass = klass
  self.method_name = method_name
  self.method_instance = method_instance
  self.decoration = block_given? ? Proc.new : nil
  validate!
end

Instance Attribute Details

#decorationObject

Returns the value of attribute decoration.



8
9
10
# File 'lib/method_decorator/models/decoration.rb', line 8

def decoration
  @decoration
end

#klassObject

Returns the value of attribute klass.



8
9
10
# File 'lib/method_decorator/models/decoration.rb', line 8

def klass
  @klass
end

#method_instanceObject

Returns the value of attribute method_instance.



8
9
10
# File 'lib/method_decorator/models/decoration.rb', line 8

def method_instance
  @method_instance
end

#method_nameObject

Returns the value of attribute method_name.



8
9
10
# File 'lib/method_decorator/models/decoration.rb', line 8

def method_name
  @method_name
end