Class: MokiRuby::DeviceIOSProfile

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contentObject

Returns the value of attribute content.



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

def content
  @content
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#display_nameObject

Returns the value of attribute display_name.



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

def display_name
  @display_name
end

#identifierObject

Returns the value of attribute identifier.



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

def identifier
  @identifier
end

#organizationObject

Returns the value of attribute organization.



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

def organization
  @organization
end

#removal_disallowedObject

Returns the value of attribute removal_disallowed.



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

def removal_disallowed
  @removal_disallowed
end

#versionObject

Returns the value of attribute version.



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

def version
  @version
end

Class Method Details

.from_hash(input_hash) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/moki_ruby/device_iosprofile.rb', line 6

def self.from_hash(input_hash)
  new_profile = self.new

  new_profile.display_name = input_hash["PayloadDisplayName"]
  new_profile.version = input_hash["PayloadVersion"]
  new_profile.organization = input_hash["PayloadOrganization"]
  new_profile.removal_disallowed = input_hash["PayloadRemovalDisallowed"]
  new_profile.description = input_hash["PayloadDescription"]
  new_profile.identifier = input_hash["PayloadIdentifier"]
  new_profile.content = input_hash["PayloadContent"]

  new_profile
end

Instance Method Details

#install_hashObject



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

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

#removal_hashObject



38
39
40
41
# File 'lib/moki_ruby/device_iosprofile.rb', line 38

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

#to_hashObject



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/moki_ruby/device_iosprofile.rb', line 20

def to_hash
  {
    "PayloadDisplayName" => self.display_name,
    "PayloadVersion" => self.version,
    "PayloadOrganization" => self.organization,
    "PayloadRemovalDisallowed" => self.removal_disallowed,
    "PayloadDescription" => self.description,
    "PayloadIdentifier" => self.identifier,
    "PayloadContent" => self.content
  }
end