Class: Cloudify::Invalidator
- Inherits:
-
Object
- Object
- Cloudify::Invalidator
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/cloudify/invalidator.rb
Instance Attribute Summary collapse
-
#distribution_id ⇒ Object
Returns the value of attribute distribution_id.
Class Method Summary collapse
Instance Method Summary collapse
- #<<(path) ⇒ Object
- #fog ⇒ Object
-
#initialize ⇒ Invalidator
constructor
A new instance of Invalidator.
- #invalidate_paths ⇒ Object
- #paths ⇒ Object
Constructor Details
Instance Attribute Details
#distribution_id ⇒ Object
Returns the value of attribute distribution_id.
6 7 8 |
# File 'lib/cloudify/invalidator.rb', line 6 def distribution_id @distribution_id end |
Class Method Details
.<<(path) ⇒ Object
14 15 16 17 18 |
# File 'lib/cloudify/invalidator.rb', line 14 def @paths.<< path raise ArgumentError unless path.kind_of? String return self if self.include?(path) super end |
Instance Method Details
#<<(path) ⇒ Object
22 23 24 25 |
# File 'lib/cloudify/invalidator.rb', line 22 def << path raise ArgumentError unless path.kind_of? String paths.include?(path) ? paths : paths << path end |
#fog ⇒ Object
27 28 29 |
# File 'lib/cloudify/invalidator.rb', line 27 def fog @invalidator end |
#invalidate_paths ⇒ Object
35 36 37 38 39 |
# File 'lib/cloudify/invalidator.rb', line 35 def invalidate_paths return if !self.valid? || !paths.any? STDERR.puts "Invalidating paths: #{paths.join(", ")}" send(invalidation_method) end |
#paths ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/cloudify/invalidator.rb', line 11 def paths @paths ||= [] def @paths.<< path raise ArgumentError unless path.kind_of? String return self if self.include?(path) super end @paths end |