Class: ChoresKit::DefinitionProxy
- Inherits:
-
Object
- Object
- ChoresKit::DefinitionProxy
- Defined in:
- lib/chores_kit/definition_proxy.rb
Instance Attribute Summary collapse
-
#chore ⇒ Object
readonly
Returns the value of attribute chore.
Instance Method Summary collapse
-
#initialize(name) ⇒ DefinitionProxy
constructor
A new instance of DefinitionProxy.
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize(name) ⇒ DefinitionProxy
5 6 7 |
# File 'lib/chores_kit/definition_proxy.rb', line 5 def initialize(name) @chore = Chore.new(name) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/chores_kit/definition_proxy.rb', line 9 def method_missing(name, *args, &block) args = {} if args.empty? if block_given? @chore.send(name, args, &block) else @chore.send(name, *args) end end |
Instance Attribute Details
#chore ⇒ Object (readonly)
Returns the value of attribute chore.
3 4 5 |
# File 'lib/chores_kit/definition_proxy.rb', line 3 def chore @chore end |