Class: Splicer::DnsMadeEasy::Client
- Inherits:
-
Object
- Object
- Splicer::DnsMadeEasy::Client
- Defined in:
- lib/splicer/dns_made_easy/client.rb
Overview
The client that talks to DnsMadeEasy
## Example Usage
client = Splicer::DnsMadeEasy::Client.new('key','secret')
client.get('dns/managed/123456')
client.post('dns/managed', {name: 'mydumbdomain.com'})
Instance Method Summary collapse
- #delete(resource, payload = {}) ⇒ String
- #get(resource, params = {}) ⇒ String
-
#initialize(key, secret) ⇒ Client
constructor
A new instance of Client.
- #post(resource, payload) ⇒ String
- #put(resource, payload) ⇒ String
Constructor Details
#initialize(key, secret) ⇒ Client
Returns a new instance of Client.
16 17 18 19 |
# File 'lib/splicer/dns_made_easy/client.rb', line 16 def initialize(key, secret) @key = key @secret = secret end |
Instance Method Details
#delete(resource, payload = {}) ⇒ String
67 68 69 70 71 72 73 74 |
# File 'lib/splicer/dns_made_easy/client.rb', line 67 def delete(resource, payload={}) execute({ method: :delete, url: resource_url(resource), payload: process_payload(payload), headers: headers }) end |
#get(resource, params = {}) ⇒ String
25 26 27 28 29 30 31 |
# File 'lib/splicer/dns_made_easy/client.rb', line 25 def get(resource, params={}) execute({ method: :get, url: resource_url(resource), headers: headers('params' => params) }) end |
#post(resource, payload) ⇒ String
39 40 41 42 43 44 45 46 |
# File 'lib/splicer/dns_made_easy/client.rb', line 39 def post(resource, payload) execute({ method: :post, url: resource_url(resource), payload: process_payload(payload), headers: headers }) end |
#put(resource, payload) ⇒ String
53 54 55 56 57 58 59 60 |
# File 'lib/splicer/dns_made_easy/client.rb', line 53 def put(resource, payload) execute({ method: :put, url: resource_url(resource), payload: process_payload(payload), headers: headers }) end |