class LightParams::Lash

Public Class Methods

from_json(json, include_root = false) click to toggle source
# File lib/light_params/lash.rb, line 18
def self.from_json(json, include_root = false)
  hash = JSON.parse(json)
  hash = hash.values.first if include_root
  new(hash)
rescue => e
  raise(Errors::JsonParseError, e.message)
end
name() click to toggle source
Calls superclass method
# File lib/light_params/lash.rb, line 14
def self.name
  @name || super
end
new(params = {}) click to toggle source
# File lib/light_params/lash.rb, line 8
def initialize(params = {})
  LashBuilder.lash_params(self, params).each_pair do |k, v|
    self[k.to_sym] = v
  end
end

Public Instance Methods

attributes() click to toggle source
# File lib/light_params/lash.rb, line 26
def attributes
  OpenStruct.new(keys: self.class.config[:properties])
end

Private Instance Methods

include_root_in_json() click to toggle source
# File lib/light_params/lash.rb, line 32
def include_root_in_json
  false
end