Class: Zm::Client::TaskJsnsInitializer

Inherits:
Object
  • Object
show all
Defined in:
lib/zm/client/task/task_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/task/task_jsns_initializer.rb', line 8

def create(parent, json)
  Task.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
42
# File 'lib/zm/client/task/task_jsns_initializer.rb', line 14

def update(item, json)
  item.uid = json.delete(:uid)
  item.priority = json.delete(:priority)
  item.ptst = json.delete(:ptst)
  item.percentComplete = json.delete(:percentComplete)
  item.name = json.delete(:name)
  item.loc = json.delete(:loc)
  item.alarm = json.delete(:alarm)
  item.isOrg = json.delete(:isOrg)
  item.id = json.delete(:id).to_i
  item.invId = json.delete(:invId)
  item.compNum = json.delete(:compNum)
  item.l = json.delete(:l).to_i
  item.status = json.delete(:status)
  item.class = json.delete(:class)
  item.allDay = json.delete(:allDay)
  item.f = json.delete(:f)
  item.tn = json.delete(:tn)
  item.t = json.delete(:t)
  item.rev = json.delete(:rev)
  item.s = json.delete(:s)
  item.d = json.delete(:d)
  item.md = json.delete(:md)
  item.ms = json.delete(:ms)
  item.cm = json.delete(:cm)
  item.sf = json.delete(:sf)

  item
end