Sha256: b757883fd792187e7b8e81b3e43dd0e6b1e758ee5a40f87a34815d198b25bde9

Contents?: true

Size: 723 Bytes

Versions: 25

Compression:

Stored size: 723 Bytes

Contents

require 'fog/core/collection'
require 'fog/slicehost/models/dns/record'

module Fog
  module DNS
    class Slicehost

      class Records < Fog::Collection

        attribute :zone

        model Fog::DNS::Slicehost::Record

        def all
          requires :zone
          data = connection.get_records.body['records']
          load(data).reject {|record| record.zone_id != zone.id}
        end

        def get(record_id)
          data = connection.get_record(record_id).body
          new(data)
        rescue Excon::Errors::Forbidden
          nil
        end

        def new(attributes = {})
          requires :zone
          super({ :zone => zone }.merge!(attributes))
        end

      end

    end
  end
end

Version data entries

25 entries across 25 versions & 7 rubygems

Version Path
brightbox-cli-0.15.0 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/records.rb
tag-fog-1.0.1 lib/fog/slicehost/models/dns/records.rb
brightbox-cli-0.14.1 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/records.rb
brightbox-cli-0.14.0 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/records.rb
fog-1.0.0 lib/fog/slicehost/models/dns/records.rb