Ryan
Ryan

Reputation: 10131

Get all CNAME records with Ruby/Fog

I am using the ruby/fog to query all CNAME records or A records of my AWS Route53 account.

items = zone.records.all!.find { |r| r.type == 'CNAME' or r.type == 'A' }

However, only one records will be returned even I have multiple matched records.

Any idea?

Upvotes: 1

Views: 301

Answers (1)

Eugene
Eugene

Reputation: 4879

Well, find only returns 1 record. The first record. Try using select instead.

Find: http://ruby-doc.org/core-2.1.0/Enumerable.html#method-i-find

Select: http://ruby-doc.org/core-2.1.0/Enumerable.html#method-i-select

Upvotes: 1

Related Questions