Class: Dozens::API
Instance Method Summary collapse
- #get_record_list(zone_name) ⇒ Object
-
#initialize(user, key) ⇒ API
constructor
A new instance of API.
- #update_record(record_id, new_value, ttl = 60) ⇒ Object
Constructor Details
#initialize(user, key) ⇒ API
Returns a new instance of API.
13 14 15 16 17 18 19 |
# File 'lib/dozens/api.rb', line 13 def initialize(user, key) @user = user @key = key r = self.class.get("/authorize.json", :headers => { "X-Auth-User" => @user, "X-Auth-Key" => @key }) @token = r['auth_token'] end |
Instance Method Details
#get_record_list(zone_name) ⇒ Object
26 27 28 |
# File 'lib/dozens/api.rb', line 26 def get_record_list(zone_name) self.class.get("/record/#{ zone_name }.json", { :headers => }) end |
#update_record(record_id, new_value, ttl = 60) ⇒ Object
21 22 23 24 |
# File 'lib/dozens/api.rb', line 21 def update_record(record_id, new_value, ttl=60) = { :body => { "content" => new_value, "ttl" => ttl }.to_json, :headers => } self.class.post("/record/update/#{ record_id }.json", ) end |