class MokiRuby::TenantIOSProfile

Attributes

description[RW]
display_name[RW]
id[RW]
identifier[RW]
last_seen[RW]
name[RW]

Public Class Methods

from_hash(input_hash) click to toggle source
# 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

Public Instance Methods

install_hash() click to toggle source
# File lib/moki_ruby/tenant_iosprofile.rb, line 28
def install_hash
  actionable_hash.merge({ "action" => "installprofile",
                          "payload" => "#{ self.id }" })
end
removal_hash() click to toggle source
# File lib/moki_ruby/tenant_iosprofile.rb, line 33
def removal_hash
  actionable_hash.merge({ "action" => "removeprofile",
                          "payload" => "{#{ self.identifier }}" })
end
to_hash() click to toggle source
# 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

Private Instance Methods

actionable_hash() click to toggle source
# File lib/moki_ruby/tenant_iosprofile.rb, line 39
def actionable_hash
  {
    "thirdPartyUser" => "moki_ruby",
    "clientName" => "MokiRuby",
    "itemName" => self.name,
    "notify" => true
  }
end