Class: Roadworker::Route53Wrapper::ResourceRecordSetCollectionWrapper
- Inherits:
-
Object
- Object
- Roadworker::Route53Wrapper::ResourceRecordSetCollectionWrapper
- Includes:
- Log
- Defined in:
- lib/roadworker/route53-wrapper.rb
Overview
HostedzoneWrapper
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(hosted_zone, options) ⇒ ResourceRecordSetCollectionWrapper
constructor
A new instance of ResourceRecordSetCollectionWrapper.
- #to_h ⇒ Hash<Array<(String,String,String)>, Roadworker::Route53Wrapper::ResourceRecordSetWrapper>
Methods included from 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, ) @hosted_zone = hosted_zone @options = end |
Instance Method Details
#each ⇒ Object
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_h ⇒ Hash<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 |