Class: Kloxo::API::Service
- Inherits:
-
Object
- Object
- Kloxo::API::Service
- Defined in:
- lib/kloxo/api/service.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#query ⇒ Object
Returns the value of attribute query.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #add_bandwidth(request) ⇒ Object
- #add_domain(request) ⇒ Object
- #change_password(request) ⇒ Object
- #change_plan(request) ⇒ Object
- #create(request) ⇒ Object
- #delete(request) ⇒ Object
- #delete_domain(request) ⇒ Object
- #disable(request) ⇒ Object
- #enable(request) ⇒ Object
- #info(request) ⇒ Object
-
#initialize(params = {}) ⇒ Service
constructor
A new instance of Service.
- #resource(request) ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Service
Returns a new instance of Service.
8 9 10 11 12 13 14 15 |
# File 'lib/kloxo/api/service.rb', line 8 def initialize params = {} self.address = params[:address] self.port = params[:port] self.username = params[:username] self.password = params[:password] HTTParty::Basement..update(verify: false) end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
6 7 8 |
# File 'lib/kloxo/api/service.rb', line 6 def address @address end |
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/kloxo/api/service.rb', line 6 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
6 7 8 |
# File 'lib/kloxo/api/service.rb', line 6 def port @port end |
#query ⇒ Object
Returns the value of attribute query.
6 7 8 |
# File 'lib/kloxo/api/service.rb', line 6 def query @query end |
#username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/kloxo/api/service.rb', line 6 def username @username end |
Instance Method Details
#add_bandwidth(request) ⇒ Object
39 40 41 42 43 |
# File 'lib/kloxo/api/service.rb', line 39 def add_bandwidth request response = HTTParty.post (self.query + request.param) Kloxo::API::Client::AddBandwidthResponse.new(response) end |
#add_domain(request) ⇒ Object
33 34 35 36 37 |
# File 'lib/kloxo/api/service.rb', line 33 def add_domain request response = HTTParty.post (self.query + request.param) Kloxo::API::Client::AddDomainResponse.new(response) end |
#change_password(request) ⇒ Object
81 82 83 84 85 |
# File 'lib/kloxo/api/service.rb', line 81 def change_password request response = HTTParty.post (self.query + request.param) Kloxo::API::Client::ChangePasswordResponse.new(response) end |
#change_plan(request) ⇒ Object
45 46 47 48 49 |
# File 'lib/kloxo/api/service.rb', line 45 def change_plan request response = HTTParty.post (self.query + request.param) Kloxo::API::Client::ChangePlanResponse.new(response) end |
#create(request) ⇒ Object
27 28 29 30 31 |
# File 'lib/kloxo/api/service.rb', line 27 def create request response = HTTParty.post (self.query + request.param) Kloxo::API::Client::CreateResponse.new(response) end |
#delete(request) ⇒ Object
63 64 65 66 67 |
# File 'lib/kloxo/api/service.rb', line 63 def delete request response = HTTParty.post (self.query + request.param) Kloxo::API::Client::DeleteResponse.new(response) end |
#delete_domain(request) ⇒ Object
51 52 53 54 55 |
# File 'lib/kloxo/api/service.rb', line 51 def delete_domain request response = HTTParty.post (self.query + request.param) Kloxo::API::Client::DeleteDomainResponse.new(response) end |
#disable(request) ⇒ Object
75 76 77 78 79 |
# File 'lib/kloxo/api/service.rb', line 75 def disable request response = HTTParty.post (self.query + request.param) Kloxo::API::Client::DisableResponse.new(response) end |
#enable(request) ⇒ Object
69 70 71 72 73 |
# File 'lib/kloxo/api/service.rb', line 69 def enable request response = HTTParty.post (self.query + request.param) Kloxo::API::Client::EnableResponse.new(response) end |
#info(request) ⇒ Object
21 22 23 24 25 |
# File 'lib/kloxo/api/service.rb', line 21 def info request response = HTTParty.get (self.query + request.param) Kloxo::API::Client::InfoResponse.new(response) end |
#resource(request) ⇒ Object
57 58 59 60 61 |
# File 'lib/kloxo/api/service.rb', line 57 def resource request response = HTTParty.post (self.query + request.param) Kloxo::API::ResourceResponse.new(response) end |