Class: DNSApp::Object
Overview
:nodoc: all
Constant Summary collapse
- @@parent_id =
nil
Class Method Summary collapse
- .check_required_keys(hash, *keys) ⇒ Object
- .delete(*args) ⇒ Object
- .get(*args) ⇒ Object
- .post(*args) ⇒ Object
- .put(*args) ⇒ Object
Instance Method Summary collapse
-
#initialize(attributes = nil) ⇒ Object
constructor
A new instance of Object.
- #parent_id ⇒ Object
- #parent_id=(id) ⇒ Object
Constructor Details
#initialize(attributes = nil) ⇒ Object
Returns a new instance of Object.
45 46 47 48 49 50 51 52 |
# File 'lib/dnsapp/object.rb', line 45 def initialize(attributes=nil) attributes and attributes.each do |key, value| setter_method = "#{key}=".to_sym if self.respond_to?(setter_method) self.send(setter_method, value) end end end |
Class Method Details
.check_required_keys(hash, *keys) ⇒ Object
54 55 56 57 |
# File 'lib/dnsapp/object.rb', line 54 def self.check_required_keys(hash, *keys) hash.is_a? Hash or raise "Options must be given as a Hash" keys.each { |key| raise "Missing required option #{key}" if hash[key].nil? } end |
.delete(*args) ⇒ Object
33 34 35 36 |
# File 'lib/dnsapp/object.rb', line 33 def delete(*args) basic_auth DNSApp::Credentials.username, DNSApp::Credentials.password super end |
.get(*args) ⇒ Object
23 24 25 26 |
# File 'lib/dnsapp/object.rb', line 23 def get(*args) basic_auth DNSApp::Credentials.username, DNSApp::Credentials.password super end |
.post(*args) ⇒ Object
28 29 30 31 |
# File 'lib/dnsapp/object.rb', line 28 def post(*args) basic_auth DNSApp::Credentials.username, DNSApp::Credentials.password super end |
.put(*args) ⇒ Object
38 39 40 41 |
# File 'lib/dnsapp/object.rb', line 38 def put(*args) basic_auth DNSApp::Credentials.username, DNSApp::Credentials.password super end |