Class: Zm::Client::DocumentJsnsInitializer

Inherits:
Object
  • Object
show all
Defined in:
lib/zm/client/document/document_jsns_initializer.rb

Overview

class for account document

Class Method Summary collapse

Class Method Details

.create(parent, json) ⇒ Object



8
9
10
11
12
# File 'lib/zm/client/document/document_jsns_initializer.rb', line 8

def create(parent, json)
  Document.new(parent).tap do |item|
    update(item, json)
  end
end

.update(item, json) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/zm/client/document/document_jsns_initializer.rb', line 14

def update(item, json)
  item.id = json.delete(:id)
  item.uuid = json.delete(:uuid)
  item.name = json.delete(:name)
  item.s = json.delete(:s)
  item.d = json.delete(:d)
  item.l = json.delete(:l)
  item.luuid = json.delete(:luuid)
  item.ms = json.delete(:ms)
  item.mdver = json.delete(:mdver)
  item.md = json.delete(:md)
  item.rev = json.delete(:rev)
  item.f = json.delete(:f)
  item.tn = json.delete(:tn)
  item.t = json.delete(:t)
  item.meta = json.delete(:meta)
  item.ct = json.delete(:ct)
  item.descEnabled = json.delete(:descEnabled)
  item.ver = json.delete(:ver)
  item.leb = json.delete(:leb)
  item.cr = json.delete(:cr)
  item.cd = json.delete(:cd)
  item.acl = json.delete(:acl)
  item.loid = json.delete(:loid)
  item.sf = json.delete(:sf)

  item
end