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.18.1 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/records.rb
michiels-fog-1.3.1 lib/fog/slicehost/models/dns/records.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/slicehost/models/dns/records.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/records.rb
fog-1.3.1 lib/fog/slicehost/models/dns/records.rb
fog-1.3.0 lib/fog/slicehost/models/dns/records.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/records.rb
fog-1.2.0 lib/fog/slicehost/models/dns/records.rb
ktheory-fog-1.1.2 lib/fog/slicehost/models/dns/records.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/records.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/records.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/records.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/records.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/records.rb
fog-1.1.2 lib/fog/slicehost/models/dns/records.rb
fog_tractical-1.1.4 lib/fog/slicehost/models/dns/records.rb
fog_tractical-1.1.3 lib/fog/slicehost/models/dns/records.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/records.rb
fog-1.1.1 lib/fog/slicehost/models/dns/records.rb
fog-1.1.0 lib/fog/slicehost/models/dns/records.rb