Sha256: 9092fca3b0238eff1b193e949bd878883655e6ca419cea79212e7a62fe4ddcab

Contents?: true

Size: 670 Bytes

Versions: 48

Compression:

Stored size: 670 Bytes

Contents

require 'ostruct'

module Spider
    
    class Scene < OpenStruct
                
        def []=(key, val)
            self.send("#{key}=", val)
        end
        
        def [](key)
            #self.send(key)
            @table[key]
        end
        
        def to_json
            @table.to_json
        end
        
        def to_hash
            @table
        end
        
        def <<(other)
            if other.is_a?(Hash)
                @table.merge!(other)
            end
        end
        
        def merge!(other)
            @table.merge!(other.instance_variable_get("@table"))
            self
        end
        
    end
    
    
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
spiderfw-1.0.1 lib/spiderfw/controller/scene.rb
spiderfw-1.0.0 lib/spiderfw/controller/scene.rb
spiderfw-0.6.39 lib/spiderfw/controller/scene.rb
spiderfw-0.6.38 lib/spiderfw/controller/scene.rb
spiderfw-0.6.37 lib/spiderfw/controller/scene.rb
spiderfw-0.6.35 lib/spiderfw/controller/scene.rb
spiderfw-0.6.34 lib/spiderfw/controller/scene.rb
spiderfw-0.6.33 lib/spiderfw/controller/scene.rb
spiderfw-0.6.32 lib/spiderfw/controller/scene.rb
spiderfw-0.6.31 lib/spiderfw/controller/scene.rb
spiderfw-0.6.30 lib/spiderfw/controller/scene.rb
spiderfw-0.6.29 lib/spiderfw/controller/scene.rb
spiderfw-0.6.28 lib/spiderfw/controller/scene.rb
spiderfw-0.6.27 lib/spiderfw/controller/scene.rb
spiderfw-0.6.26 lib/spiderfw/controller/scene.rb
spiderfw-0.6.26.pre1 lib/spiderfw/controller/scene.rb
spiderfw-0.6.25 lib/spiderfw/controller/scene.rb
spiderfw-0.6.24 lib/spiderfw/controller/scene.rb
spiderfw-0.6.23 lib/spiderfw/controller/scene.rb
spiderfw-0.6.22 lib/spiderfw/controller/scene.rb