Method: Megam::Credithistories.json_create

Defined in:
lib/megam/core/credithistories.rb

.json_create(o) ⇒ Object



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/megam/core/credithistories.rb', line 128

def self.json_create(o)
  cts = new
  cts.id(o["id"]) if o.has_key?("id")
  cts.accounts_id(o["accounts_id"]) if o.has_key?("accounts_id")
  cts.bill_type(o["bill_type"]) if o.has_key?("bill_type")
  cts.credit_amount(o["credit_amount"]) if o.has_key?("credit_amount")
  cts.currency_type(o["currency_type"]) if o.has_key?("currency_type")

  cts.created_at(o["created_at"]) if o.has_key?("created_at")
  #success or error
  cts.some_msg[:code] = o["code"] if o.has_key?("code")
  cts.some_msg[:msg_type] = o["msg_type"] if o.has_key?("msg_type")
  cts.some_msg[:msg]= o["msg"] if o.has_key?("msg")
  cts.some_msg[:links] = o["links"] if o.has_key?("links")
  cts
end