Class: IOSConfig::Payload::Base
- Inherits:
-
Object
- Object
- IOSConfig::Payload::Base
- Defined in:
- lib/ios_config/payload/base.rb
Direct Known Subclasses
AirPlay, AirPrint, Certificate, Custom, SingleSignOnAccount, VPN, WiFi
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#uuid ⇒ Object
Returns the value of attribute uuid.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(attributes = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(attributes = {}) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ios_config/payload/base.rb', line 9 def initialize(attributes = {}) attributes ||= {} attributes.each do |name, value| begin send("#{name}=", value) rescue NoMethodError => e raise ArgumentError, %{"#{name}" is not a valid attribute} end end @uuid ||= SecureRandom.uuid @identifier ||= @uuid.downcase.delete("^a-z0-9\.") @description ||= "" end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
7 8 9 |
# File 'lib/ios_config/payload/base.rb', line 7 def description @description end |
#identifier ⇒ Object
Returns the value of attribute identifier.
7 8 9 |
# File 'lib/ios_config/payload/base.rb', line 7 def identifier @identifier end |
#uuid ⇒ Object
Returns the value of attribute uuid.
7 8 9 |
# File 'lib/ios_config/payload/base.rb', line 7 def uuid @uuid end |
Instance Method Details
#build ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/ios_config/payload/base.rb', line 24 def build p = { 'PayloadType' => payload_type, 'PayloadVersion' => payload_version, 'PayloadUUID' => @uuid, 'PayloadIdentifier' => @identifier, 'PayloadDescription' => @description } p.merge payload end |