Class: MokiRuby::TenantIOSProfile

Inherits:
Object
  • Object
show all
Defined in:
lib/moki_ruby/tenant_iosprofile.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/moki_ruby/tenant_iosprofile.rb', line 3

def description
  @description
end

#display_nameObject

Returns the value of attribute display_name.



3
4
5
# File 'lib/moki_ruby/tenant_iosprofile.rb', line 3

def display_name
  @display_name
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/moki_ruby/tenant_iosprofile.rb', line 3

def id
  @id
end

#identifierObject

Returns the value of attribute identifier.



3
4
5
# File 'lib/moki_ruby/tenant_iosprofile.rb', line 3

def identifier
  @identifier
end

#last_seenObject

Returns the value of attribute last_seen.



3
4
5
# File 'lib/moki_ruby/tenant_iosprofile.rb', line 3

def last_seen
  @last_seen
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/moki_ruby/tenant_iosprofile.rb', line 3

def name
  @name
end

Class Method Details

.from_hash(input_hash) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/moki_ruby/tenant_iosprofile.rb', line 5

def self.from_hash(input_hash)
  new_profile = self.new
  new_profile.id = input_hash["id"]
  new_profile.last_seen = input_hash["lastSeen"]
  new_profile.name = input_hash["name"]
  new_profile.display_name = input_hash["displayName"]
  new_profile.description = input_hash["description"]
  new_profile.identifier = input_hash["identifier"]

  new_profile
end

Instance Method Details

#install_hashObject



28
29
30
31
# File 'lib/moki_ruby/tenant_iosprofile.rb', line 28

def install_hash
  actionable_hash.merge({ "action" => "installprofile",
                          "payload" => "{#{ self.id }}" })
end

#removal_hashObject



33
34
35
36
# File 'lib/moki_ruby/tenant_iosprofile.rb', line 33

def removal_hash
  actionable_hash.merge({ "action" => "removeprofile",
                          "payload" => "{#{ self.identifier }}" })
end

#to_hashObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/moki_ruby/tenant_iosprofile.rb', line 17

def to_hash
  {
    "id" => self.id,
    "lastSeen" => self.last_seen,
    "name" => self.name,
    "displayName" => self.display_name,
    "description" => self.description,
    "identifier" => self.identifier
  }
end