Class: Spider::Scene

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/spiderfw/controller/scene.rb

Instance Method Summary collapse

Instance Method Details

#<<(other) ⇒ Object



24
25
26
27
28
# File 'lib/spiderfw/controller/scene.rb', line 24

def <<(other)
    if other.is_a?(Hash)
        @table.merge!(other)
    end
end

#[](key) ⇒ Object



11
12
13
14
# File 'lib/spiderfw/controller/scene.rb', line 11

def [](key)
    #self.send(key)
    @table[key]
end

#[]=(key, val) ⇒ Object



7
8
9
# File 'lib/spiderfw/controller/scene.rb', line 7

def []=(key, val)
    self.send("#{key}=", val)
end

#merge!(other) ⇒ Object



30
31
32
33
# File 'lib/spiderfw/controller/scene.rb', line 30

def merge!(other)
    @table.merge!(other.instance_variable_get("@table"))
    self
end

#to_hashObject



20
21
22
# File 'lib/spiderfw/controller/scene.rb', line 20

def to_hash
    @table
end

#to_jsonObject



16
17
18
# File 'lib/spiderfw/controller/scene.rb', line 16

def to_json
    @table.to_json
end