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.
19
20
21
|
# File 'lib/ydim/html/state/global.rb', line 19
def initialize
@carry = {}
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(key, *args) ⇒ Object
25
26
27
28
29
30
31
|
# File 'lib/ydim/html/state/global.rb', line 25
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
22
23
24
|
# File 'lib/ydim/html/state/global.rb', line 22
def carry(key, val)
@carry.store(key, val)
end
|
#respond_to?(key) ⇒ Boolean
32
33
34
|
# File 'lib/ydim/html/state/global.rb', line 32
def respond_to?(key)
true
end
|