Class: Datapimp::Sync::CloudfrontDistribution

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/datapimp/sync/cloudfront_distribution.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

#log, #logger, #logger=

Constructor Details

#initialize(options = {}) ⇒ CloudfrontDistribution

Returns a new instance of CloudfrontDistribution.



8
9
10
# File 'lib/datapimp/sync/cloudfront_distribution.rb', line 8

def initialize(options={})
  @bucket = options.fetch(:bucket)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object



18
19
20
# File 'lib/datapimp/sync/cloudfront_distribution.rb', line 18

def method_missing(meth, *args, &block)
  cloudfront && cloudfront.send(meth, *args, &block)
end

Instance Attribute Details

#bucketObject

Returns the value of attribute bucket.



6
7
8
# File 'lib/datapimp/sync/cloudfront_distribution.rb', line 6

def bucket
  @bucket
end

Instance Method Details

#cloudfrontObject



12
13
14
15
16
# File 'lib/datapimp/sync/cloudfront_distribution.rb', line 12

def cloudfront
  @cloudfront ||= Datapimp::Sync.amazon.cdn.distributions.detect do |dist|
    dist.comment == bucket
  end
end