Class: Jirify::Models::Base
- Inherits:
-
Object
- Object
- Jirify::Models::Base
- Defined in:
- lib/jirify/models/base.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(entity) ⇒ Base
constructor
A new instance of Base.
- #method_missing(method, *args, &_block) ⇒ Object
- #respond_to_missing?(method) ⇒ Boolean
Constructor Details
#initialize(entity) ⇒ Base
Returns a new instance of Base.
4 5 6 |
# File 'lib/jirify/models/base.rb', line 4 def initialize(entity) @entity = entity end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &_block) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/jirify/models/base.rb', line 8 def method_missing(method, *args, &_block) if @entity.respond_to? method @entity.send method, *args else super end end |
Class Method Details
Instance Method Details
#respond_to_missing?(method) ⇒ Boolean
16 17 18 |
# File 'lib/jirify/models/base.rb', line 16 def respond_to_missing?(method, *) @entity.respond_to? method end |