Class: Zm::Client::ShareJsnsInitializer

Inherits:
Object
  • Object
show all
Defined in:
lib/zm/client/share/share_jsns_initializer.rb

Overview

class for account share

Class Method Summary collapse

Class Method Details

.create(parent, json) ⇒ Object



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

def create(parent, json)
  Share.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
# File 'lib/zm/client/share/share_jsns_initializer.rb', line 14

def update(item, json)
  item.ownerId = json.delete(:ownerId)
  item.ownerEmail = json.delete(:ownerEmail)
  item.ownerName = json.delete(:ownerName)
  item.folderId = json.delete(:folderId)
  item.folderUuid = json.delete(:folderUuid)
  item.folderPath = json.delete(:folderPath)
  item.view = json.delete(:view)
  item.rights = json.delete(:rights)
  item.granteeType = json.delete(:granteeType)
  item.granteeId = json.delete(:granteeId)
  item.granteeName = json.delete(:granteeName)
  item.mid = json.delete(:mid)

  item
end