Class: AASM::DslHelper::Proxy
- Inherits:
-
Object
- Object
- AASM::DslHelper::Proxy
- Defined in:
- lib/aasm/dsl_helper.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options, valid_keys, source) ⇒ Proxy
constructor
A new instance of Proxy.
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize(options, valid_keys, source) ⇒ Proxy
Returns a new instance of Proxy.
7 8 9 10 11 12 |
# File 'lib/aasm/dsl_helper.rb', line 7 def initialize(, valid_keys, source) @valid_keys = valid_keys @source = source @options = end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/aasm/dsl_helper.rb', line 14 def method_missing(name, *args, &block) if @valid_keys.include?(name) [name] = Array([name]) [name] << block if block [name] += Array(args) else @source.send name, *args, &block end end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/aasm/dsl_helper.rb', line 5 def @options end |