Class: Grocer::Pushpackager::Package
- Inherits:
-
Object
- Object
- Grocer::Pushpackager::Package
- Defined in:
- lib/grocer/pushpackager/package.rb
Instance Attribute Summary collapse
-
#certificate ⇒ Object
Returns the value of attribute certificate.
-
#icon_set ⇒ Object
Returns the value of attribute icon_set.
-
#key ⇒ Object
Returns the value of attribute key.
-
#website ⇒ Object
Returns the value of attribute website.
Instance Method Summary collapse
- #authentication_token=(value) ⇒ Object
- #file ⇒ Object
-
#initialize(config = {}) ⇒ Package
constructor
A new instance of Package.
- #valid? ⇒ Boolean
Constructor Details
Instance Attribute Details
#certificate ⇒ Object
Returns the value of attribute certificate.
10 11 12 |
# File 'lib/grocer/pushpackager/package.rb', line 10 def certificate @certificate end |
#icon_set ⇒ Object
Returns the value of attribute icon_set.
10 11 12 |
# File 'lib/grocer/pushpackager/package.rb', line 10 def icon_set @icon_set end |
#key ⇒ Object
Returns the value of attribute key.
10 11 12 |
# File 'lib/grocer/pushpackager/package.rb', line 10 def key @key end |
#website ⇒ Object
Returns the value of attribute website.
10 11 12 |
# File 'lib/grocer/pushpackager/package.rb', line 10 def website @website end |
Instance Method Details
#authentication_token=(value) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/grocer/pushpackager/package.rb', line 19 def authentication_token= value @website.authentication_token = value @signature = nil @website_json = nil @manifest_json = nil end |
#file ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/grocer/pushpackager/package.rb', line 34 def file raise unless self.valid? package = Tempfile.new('package') package.write(build_zip.string) package.close package end |
#valid? ⇒ Boolean
26 27 28 29 30 31 32 |
# File 'lib/grocer/pushpackager/package.rb', line 26 def valid? @icon_set.valid? @website.valid? raise ArgumentError, "Missing private key" unless @key raise ArgumentError, "Missing certificate" unless @certificate true end |