Class: YDIM::Html::State::Global::Stub
- Inherits:
-
Object
- Object
- YDIM::Html::State::Global::Stub
show all
- Defined in:
- lib/ydim/html/state/global.rb
Instance Method Summary
collapse
Constructor Details
#initialize ⇒ Stub
Returns a new instance of Stub.
20
21
22
|
# File 'lib/ydim/html/state/global.rb', line 20
def initialize
@carry = {}
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(key, *args) ⇒ Object
26
27
28
29
30
31
32
|
# File 'lib/ydim/html/state/global.rb', line 26
def method_missing(key, *args)
if(match = /^(.*)=$/.match(key.to_s))
@carry[match[1].to_sym] = args.first
else
@carry[key]
end
end
|
Instance Method Details
#carry(key, val) ⇒ Object
23
24
25
|
# File 'lib/ydim/html/state/global.rb', line 23
def carry(key, val)
@carry.store(key, val)
end
|
#respond_to?(key) ⇒ Boolean
33
34
35
|
# File 'lib/ydim/html/state/global.rb', line 33
def respond_to?(key)
true
end
|