Class: Haberdasher::Decorator

Inherits:
Object
  • Object
show all
Defined in:
lib/haberdasher/decorator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ Decorator

Returns a new instance of Decorator.



5
6
7
# File 'lib/haberdasher/decorator.rb', line 5

def initialize model
  @model = model
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



9
10
11
# File 'lib/haberdasher/decorator.rb', line 9

def method_missing method, *args, &block
  model.send method, *args, &block
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



3
4
5
# File 'lib/haberdasher/decorator.rb', line 3

def model
  @model
end