Class: Nifcloud::Client
Direct Known Subclasses
Constant Summary collapse
- ENDPOINT =
'https://dns.api.nifcloud.com/'- VERSION =
'2012-12-12N2013-12-16'- AUTHORIZATION_HEADER =
'X-Nifty-Authorization'- DATE_HEADER =
'X-Nifty-Date'- NAMESPACE =
'https://route53.amazonaws.com/doc/2012-12-12/'
Constants inherited from Auth
Instance Attribute Summary
Attributes inherited from Auth
Instance Method Summary collapse
- #delete(path) ⇒ Object
- #get(path) ⇒ Object
-
#initialize(access_key, secret_key) ⇒ Client
constructor
A new instance of Client.
- #post(path, body) ⇒ Object
Methods inherited from Auth
Constructor Details
#initialize(access_key, secret_key) ⇒ Client
Returns a new instance of Client.
13 14 15 16 |
# File 'lib/nifcloud/client.rb', line 13 def initialize(access_key, secret_key) super(access_key, secret_key) @http, @req, @uri = nil end |
Instance Method Details
#delete(path) ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/nifcloud/client.rb', line 36 def delete path init path @req = Net::HTTP::Delete.new @uri.request_uri init_header res = call Nifcloud::DNS::Response.new(XmlSimple.xml_in(res.body), res.code, res.body) end |
#get(path) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/nifcloud/client.rb', line 18 def get path init path @req = Net::HTTP::Get.new @uri.request_uri init_header res = call Nifcloud::DNS::Response.new(XmlSimple.xml_in(res.body), res.code, res.body) end |
#post(path, body) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/nifcloud/client.rb', line 26 def post(path, body) init path @req = Net::HTTP::Post.new @uri.request_uri @req.body = body @req.content_type = 'text/xml' init_header res = call Nifcloud::DNS::Response.new(XmlSimple.xml_in(res.body), res.code, res.body) end |