class Biosphere::Node
Attributes
data[R]
Public Class Methods
new(from = nil)
click to toggle source
# File lib/biosphere/node.rb, line 32 def initialize(from = nil) if from && from.is_a?(String) blob = Marshal.load(from) if blob.class == Biosphere::Node raise "Tried to load old state format. Unfortunately we are not backwards compatible" end @data = blob elsif from @data = from else @data = Attribute.new end end
Public Instance Methods
[](symbol, *args)
click to toggle source
# File lib/biosphere/node.rb, line 66 def [](symbol, *args) return @data[symbol] end
[]=(symbol, *args)
click to toggle source
# File lib/biosphere/node.rb, line 62 def []=(symbol, *args) @data[symbol] = args[0] end
data=(s)
click to toggle source
# File lib/biosphere/node.rb, line 50 def data=(s) @data = s end
deep_set(*args)
click to toggle source
# File lib/biosphere/node.rb, line 58 def deep_set(*args) @data.deep_set(*args) end
include?(symbol)
click to toggle source
# File lib/biosphere/node.rb, line 54 def include?(symbol) @data.include?(symbol) end
merge!(obj)
click to toggle source
# File lib/biosphere/node.rb, line 70 def merge!(obj) @data.deep_merge!(obj) end
save()
click to toggle source
# File lib/biosphere/node.rb, line 74 def save() return Marshal.dump(@data) end
values()
click to toggle source
# File lib/biosphere/node.rb, line 78 def values return @data.values end