Class: Fog::CDN::AWS::Invalidation
- Inherits:
-
Model
- Object
- Model
- Fog::CDN::AWS::Invalidation
- Defined in:
- lib/fog/aws/models/cdn/invalidation.rb
Instance Method Summary collapse
- #destroy ⇒ Object
- #distribution ⇒ Object
-
#initialize(new_attributes = {}) ⇒ Invalidation
constructor
A new instance of Invalidation.
- #ready? ⇒ Boolean
- #save ⇒ Object
Constructor Details
#initialize(new_attributes = {}) ⇒ Invalidation
Returns a new instance of Invalidation.
14 15 16 17 |
# File 'lib/fog/aws/models/cdn/invalidation.rb', line 14 def initialize(new_attributes={}) new_attributes[:caller_reference] ||= Time.now.utc.to_i.to_s super(invalidation_to_attributes(new_attributes)) end |
Instance Method Details
#destroy ⇒ Object
36 37 38 39 |
# File 'lib/fog/aws/models/cdn/invalidation.rb', line 36 def destroy # invalidations can't be removed, but tests are requiring they do :) true end |
#distribution ⇒ Object
19 20 21 |
# File 'lib/fog/aws/models/cdn/invalidation.rb', line 19 def distribution @distribution end |
#ready? ⇒ Boolean
23 24 25 26 |
# File 'lib/fog/aws/models/cdn/invalidation.rb', line 23 def ready? requires :id, :status status == 'Completed' end |
#save ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/fog/aws/models/cdn/invalidation.rb', line 28 def save requires :paths, :caller_reference raise "Submitted invalidation cannot be submitted again" if persisted? response = service.post_invalidation(distribution.identity, paths, caller_reference) merge_attributes(invalidation_to_attributes(response.body)) true end |