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
# File 'lib/zm/client/document/document_jsns_initializer.rb', line 8

def create(parent, json)
  item = Document.new(parent)
  update(item, json)
end

.update(item, json) ⇒ Object



13
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
# File 'lib/zm/client/document/document_jsns_initializer.rb', line 13

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

  item
end