Class: MokiRuby::TenantManagedApp
- Inherits:
-
Object
- Object
- MokiRuby::TenantManagedApp
- Defined in:
- lib/moki_ruby/tenant_managed_app.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#itunes_store_id ⇒ Object
Returns the value of attribute itunes_store_id.
-
#last_seen ⇒ Object
Returns the value of attribute last_seen.
-
#management_flags ⇒ Object
Returns the value of attribute management_flags.
-
#manifest_url ⇒ Object
Returns the value of attribute manifest_url.
-
#name ⇒ Object
Returns the value of attribute name.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/moki_ruby/tenant_managed_app.rb', line 3 def id @id end |
#identifier ⇒ Object
Returns the value of attribute identifier.
3 4 5 |
# File 'lib/moki_ruby/tenant_managed_app.rb', line 3 def identifier @identifier end |
#itunes_store_id ⇒ Object
Returns the value of attribute itunes_store_id.
3 4 5 |
# File 'lib/moki_ruby/tenant_managed_app.rb', line 3 def itunes_store_id @itunes_store_id end |
#last_seen ⇒ Object
Returns the value of attribute last_seen.
3 4 5 |
# File 'lib/moki_ruby/tenant_managed_app.rb', line 3 def last_seen @last_seen end |
#management_flags ⇒ Object
Returns the value of attribute management_flags.
3 4 5 |
# File 'lib/moki_ruby/tenant_managed_app.rb', line 3 def management_flags @management_flags end |
#manifest_url ⇒ Object
Returns the value of attribute manifest_url.
3 4 5 |
# File 'lib/moki_ruby/tenant_managed_app.rb', line 3 def manifest_url @manifest_url end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/moki_ruby/tenant_managed_app.rb', line 3 def name @name end |
#version ⇒ Object
Returns the value of attribute version.
3 4 5 |
# File 'lib/moki_ruby/tenant_managed_app.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/tenant_managed_app.rb', line 6 def self.from_hash(input_hash) new_app = self.new new_app.id = input_hash["id"] new_app.last_seen = input_hash["lastSeen"] new_app.name = input_hash["name"] new_app.identifier = input_hash["identifier"] new_app.version = input_hash["version"] new_app.management_flags = input_hash["ManagementFlags"] new_app.itunes_store_id = input_hash["iTunesStoreID"] new_app.manifest_url = input_hash["ManifestURL"] new_app end |
Instance Method Details
#external_locator_hash ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/moki_ruby/tenant_managed_app.rb', line 50 def external_locator_hash if manifest_url && manifest_url != "" { "ManifestURL" => manifest_url } else { "iTunesStoreID" => itunes_store_id } end end |
#install_hash ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/moki_ruby/tenant_managed_app.rb', line 31 def install_hash { "action" => "install_app", "thirdPartyUser" => "moki_ruby", "clientName" => "MokiRuby", "itemName" => self.name || "iOS App", "notify" => true, "payload" => { "ManagementFlags" => self.management_flag, "identifier" => self.identifier, "version" => self.version }.merge(self.external_locator_hash) } end |
#management_flag ⇒ Object
46 47 48 |
# File 'lib/moki_ruby/tenant_managed_app.rb', line 46 def management_flag (!manifest_url.nil? && manifest_url != "") ? 1 : 0 end |
#to_hash ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/moki_ruby/tenant_managed_app.rb', line 20 def to_hash { "id" => self.id, "lastSeen" => self.last_seen, "name" => self.name, "identifier" => self.identifier, "version" => self.version, "ManagementFlags" => self.management_flags, "iTunesStoreID" => self.itunes_store_id, "ManifestURL" => self.manifest_url } end |