Class: Woody::Decorators::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/woody/decorators/base.rb

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ Base

Returns a new instance of Base.



4
5
6
# File 'lib/woody/decorators/base.rb', line 4

def initialize(model)
  @model = model.is_a?(Hash) ? OpenStruct.new(model) : model
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(key, *args) ⇒ Object



8
9
10
# File 'lib/woody/decorators/base.rb', line 8

def method_missing(key, *args)
  @model.send(key, *args)
end