Class: Woody::Decorators::Base
- Inherits:
-
Object
- Object
- Woody::Decorators::Base
- Defined in:
- lib/woody/decorators/base.rb
Direct Known Subclasses
Brand, Brief, BriefQuestion, Collective, Submission, User, Video, VideoTranscodingState
Instance Method Summary collapse
-
#initialize(model) ⇒ Base
constructor
A new instance of Base.
- #method_missing(key, *args) ⇒ Object
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 |