Class: Cumulus::CloudFront::InvalidationConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudfront/models/InvalidationConfig.rb

Overview

Public: An object representing configuration for a CloudFront invalidation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, json = nil) ⇒ InvalidationConfig

Public: Constructor

json - a hash containing the JSON configuration for the invalidation



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/cloudfront/models/InvalidationConfig.rb', line 14

def initialize(name, json = nil)
  if json
    @name = name

    begin
      @distribution_id = json.fetch("distribution-id")
    rescue KeyError
      puts "Must supply 'distribution-id' in invalidation config"
      exit
    end

    begin
      @paths = json.fetch("paths")
    rescue KeyError
      puts "Must supply 'paths' in invalidation config"
      exit
    end

  end
end

Instance Attribute Details

#distribution_idObject (readonly)

Returns the value of attribute distribution_id.



7
8
9
# File 'lib/cloudfront/models/InvalidationConfig.rb', line 7

def distribution_id
  @distribution_id
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/cloudfront/models/InvalidationConfig.rb', line 9

def name
  @name
end

#pathsObject (readonly)

Returns the value of attribute paths.



8
9
10
# File 'lib/cloudfront/models/InvalidationConfig.rb', line 8

def paths
  @paths
end