Sha256: 3d4aea671e9da5a365a22445a43192f9a534c287ea0ae7abc36d6f8dc813ac06

Contents?: true

Size: 766 Bytes

Versions: 38

Compression:

Stored size: 766 Bytes

Contents

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

module Fog
  module DNS
    class DNSimple

      class Records < Fog::Collection

        attribute :zone

        model Fog::DNS::DNSimple::Record

        def all
          requires :zone
          clear
          data = connection.list_records(zone.id).body.map {|record| record['record']}
          load(data)
        end

        def get(record_id)
          requires :zone
          data = connection.get_record(zone.id, record_id).body["record"]
          new(data)
        rescue Excon::Errors::NotFound
          nil
        end

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

      end

    end
  end
end

Version data entries

38 entries across 38 versions & 13 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/dnsimple/models/dns/records.rb
fog-nirvanix-1.8.1 lib/fog/dnsimple/models/dns/records.rb
fog-parser-fix-1.6.1 lib/fog/dnsimple/models/dns/records.rb
fog-test-again-1.6.0 lib/fog/dnsimple/models/dns/records.rb
fog-parser-fix-1.6.0 lib/fog/dnsimple/models/dns/records.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/dnsimple/models/dns/records.rb
fog-sgonyea-1.8.1 lib/fog/dnsimple/models/dns/records.rb
fog-1.8.0 lib/fog/dnsimple/models/dns/records.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/dnsimple/models/dns/records.rb
fog-1.7.0 lib/fog/dnsimple/models/dns/records.rb
fog-1.6.0 lib/fog/dnsimple/models/dns/records.rb
fog-1.5.0 lib/fog/dnsimple/models/dns/records.rb
fog-1.4.0 lib/fog/dnsimple/models/dns/records.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/dnsimple/models/dns/records.rb
michiels-fog-1.3.1 lib/fog/dnsimple/models/dns/records.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/dnsimple/models/dns/records.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/dnsimple/models/dns/records.rb
fog-1.3.1 lib/fog/dnsimple/models/dns/records.rb
fog-1.3.0 lib/fog/dnsimple/models/dns/records.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/dnsimple/models/dns/records.rb