Class: PDNS::Client
Overview
Client
Instance Attribute Summary collapse
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Attributes inherited from API
Instance Method Summary collapse
-
#servers(id = nil) ⇒ Object
(also: #server)
Main methods.
Methods inherited from API
#create, #delete, #ensure_array, #get, hash_string_to_sym, hash_sym_to_string, #info, #initialize
Constructor Details
This class inherits a constructor from PDNS::API
Instance Attribute Details
#version ⇒ Object (readonly)
Returns the value of attribute version.
9 10 11 |
# File 'lib/pdns_api/client.rb', line 9 def version @version end |
Instance Method Details
#servers(id = nil) ⇒ Object Also known as: server
Main methods
12 13 14 15 16 17 18 |
# File 'lib/pdns_api/client.rb', line 12 def servers(id = nil) return Server.new(@http, self, id) unless id.nil? # Return a hash of server objects servers = @http.get "#{@url}/servers" servers.map! { |s| [s[:id], Server.new(@http, self, s[:id], s)] }.to_h end |