Method: Megam::CSAR.json_create

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

.json_create(o) ⇒ Object



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/megam/core/csar.rb', line 113

def self.json_create(o)
  csarjslf = new
  csarjslf.id(o["id"]) if o.has_key?("id")
  csarjslf.desc(o["desc"]) if o.has_key?("desc")
  csarjslf.link(o["link"]) if o.has_key?("link")
  csarjslf.created_at(o["created_at"]) if o.has_key?("created_at")

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

  csarjslf
end