class Slnky::Data

Public Class Methods

new(hash={}) click to toggle source
Calls superclass method DeepStruct::new
# File lib/slnky/data.rb, line 6
def initialize(hash={})
  if hash.is_a?(Slnky::Data)
    hash = hash.to_h
  end
  super(hash)
end
parse(str) click to toggle source
# File lib/slnky/data.rb, line 22
def parse(str)
  new(JSON.parse(str))
end

Public Instance Methods

delete(name) click to toggle source
# File lib/slnky/data.rb, line 17
def delete(name)
  self.delete_field(name) || self.delete_field(name.to_s)
end
to_s() click to toggle source
# File lib/slnky/data.rb, line 13
def to_s
  to_h.to_json
end