Class: DNSimple::ExtendedAttribute
- Defined in:
- lib/dnsimple/extended_attribute.rb
Overview
Used for domains that require extended attributes.
Defined Under Namespace
Classes: Option
Instance Attribute Summary collapse
-
#description ⇒ Object
A description of the extended attribute.
-
#name ⇒ Object
The extended attribute name.
-
#required ⇒ Object
Boolean indicating if the extended attribute is required.
Class Method Summary collapse
-
.find(tld, options = {}) ⇒ Object
Find the extended attributes for the given TLD.
Instance Method Summary collapse
-
#options ⇒ Object
An array of options for the extended attribute.
- #options=(opts) ⇒ Object
Methods inherited from Base
Constructor Details
This class inherits a constructor from DNSimple::Base
Instance Attribute Details
#description ⇒ Object
A description of the extended attribute
22 23 24 |
# File 'lib/dnsimple/extended_attribute.rb', line 22 def description @description end |
#name ⇒ Object
The extended attribute name
19 20 21 |
# File 'lib/dnsimple/extended_attribute.rb', line 19 def name @name end |
#required ⇒ Object
Boolean indicating if the extended attribute is required
25 26 27 |
# File 'lib/dnsimple/extended_attribute.rb', line 25 def required @required end |
Class Method Details
.find(tld, options = {}) ⇒ Object
Find the extended attributes for the given TLD
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/dnsimple/extended_attribute.rb', line 40 def self.find(tld, ={}) response = DNSimple::Client.get("/v1/extended_attributes/#{tld}", ) case response.code when 200 response.map { |r| new(r) } else raise RequestError.new("Error finding extended attributes", response) end end |
Instance Method Details
#options ⇒ Object
An array of options for the extended attribute
28 29 30 |
# File 'lib/dnsimple/extended_attribute.rb', line 28 def @options ||= [] end |
#options=(opts) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/dnsimple/extended_attribute.rb', line 32 def (opts) @options = [] opts.each do |opt| @options << DNSimple::ExtendedAttribute::Option.new(opt) end end |