Method: Megam::AppRequest.json_create

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

.json_create(o) ⇒ Object



116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/megam/core/app_request.rb', line 116

def self.json_create(o)
  node = new
  node.id(o["id"]) if o.has_key?("id")
  node.app_id(o["app_id"]) if o.has_key?("app_id")
  node.app_name(o["app_name"]) if o.has_key?("app_name")
  node.action(o["action"]) if o.has_key?("action")     
  node.created_at(o["created_at"]) if o.has_key?("created_at")
  #success or error
  node.some_msg[:code] = o["code"] if o.has_key?("code")
  node.some_msg[:msg_type] = o["msg_type"] if o.has_key?("msg_type")
  node.some_msg[:msg]= o["msg"] if o.has_key?("msg")
  node.some_msg[:links] = o["links"] if o.has_key?("links")
  node
end