Method: Megam::SshKey.json_create

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

.json_create(o) ⇒ Object



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

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