Class: Roadworker::Route53Wrapper::HostedZoneCollectionWrapper
- Inherits:
-
Object
- Object
- Roadworker::Route53Wrapper::HostedZoneCollectionWrapper
- Includes:
- Log
- Defined in:
- lib/roadworker/route53-wrapper.rb
Instance Method Summary collapse
- #create(name, opts = {}) ⇒ Object
- #each ⇒ Object
-
#initialize(hosted_zones, options) ⇒ HostedZoneCollectionWrapper
constructor
A new instance of HostedZoneCollectionWrapper.
Methods included from Log
Constructor Details
#initialize(hosted_zones, options) ⇒ HostedZoneCollectionWrapper
Returns a new instance of HostedZoneCollectionWrapper.
37 38 39 40 |
# File 'lib/roadworker/route53-wrapper.rb', line 37 def initialize(hosted_zones, ) @hosted_zones = hosted_zones @options = end |
Instance Method Details
#create(name, opts = {}) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/roadworker/route53-wrapper.rb', line 48 def create(name, opts = {}) log(:info, 'Create HostedZone', :cyan, name) if @options.dry_run zone = OpenStruct.new({:name => name, :rrsets => []}.merge(opts)) else zone = @hosted_zones.create(name, opts) @options.hosted_zone_name = name @options.updated = true end HostedZoneWrapper.new(zone, @options) end |
#each ⇒ Object
42 43 44 45 46 |
# File 'lib/roadworker/route53-wrapper.rb', line 42 def each Collection.batch(@hosted_zones) do |zone| yield(HostedZoneWrapper.new(zone, @options)) end end |