Class: Roadworker::Route53Wrapper::ResourceRecordSetCollectionWrapper

Inherits:
Object
  • Object
show all
Includes:
Log
Defined in:
lib/roadworker/route53-wrapper.rb

Overview

HostedzoneWrapper

Instance Method Summary collapse

Methods included from Log

#log

Constructor Details

#initialize(hosted_zone, options) ⇒ ResourceRecordSetCollectionWrapper

Returns a new instance of ResourceRecordSetCollectionWrapper.



148
149
150
151
# File 'lib/roadworker/route53-wrapper.rb', line 148

def initialize(hosted_zone, options)
  @hosted_zone = hosted_zone
  @options = options
end

Instance Method Details

#eachObject



165
166
167
168
169
170
171
# File 'lib/roadworker/route53-wrapper.rb', line 165

def each
  if @hosted_zone.id
    Collection.batch(@options.route53.list_resource_record_sets(hosted_zone_id: @hosted_zone.id), :resource_record_sets) do |record|
      yield(ResourceRecordSetWrapper.new(record, @hosted_zone, @options))
    end
  end
end

#to_hHash<Array<(String,String,String)>, Roadworker::Route53Wrapper::ResourceRecordSetWrapper>



154
155
156
157
158
159
160
161
162
163
# File 'lib/roadworker/route53-wrapper.rb', line 154

def to_h
  return @hash if defined? @hash
  @hash = {}

  self.each do |item|
    @hash[[item.name, item.type, item.set_identifier]] = item
  end

  @hash
end