class OneApi::Conversions
Public Class Methods
fill_from_json(object, json, is_error=nil)
click to toggle source
# File lib/oneapi-ruby/objects.rb, line 134 def self.fill_from_json(object, json, is_error=nil) if is_error object.exception = Conversions.from_json(OneApiError, json, false) return end json = JSONUtils.get_json(json) conversion_rules = OneApiAccessorModifier.get_field_conversion_rules(object.class) for conversion_rule in conversion_rules json_value = JSONUtils.get(json, conversion_rule.json_field_name) value = conversion_rule.from_json(json_value) object.instance_variable_set("@#{conversion_rule.object_field_name}", value) end end
from_json(classs, json, is_error=nil)
click to toggle source
# File lib/oneapi-ruby/objects.rb, line 126 def self.from_json(classs, json, is_error=nil) object = classs.new Conversions.fill_from_json(object, json, is_error) object end
to_json()
click to toggle source
# File lib/oneapi-ruby/objects.rb, line 149 def self.to_json # TODO(TK) end