Class: Itexmo::Service
- Inherits:
-
Object
- Object
- Itexmo::Service
- Defined in:
- lib/itexmo/service.rb
Overview
service
Constant Summary collapse
- API_ENDPOINT =
'https://www.itexmo.com/php_api'.freeze
Instance Attribute Summary collapse
-
#api_code ⇒ Object
Returns the value of attribute api_code.
Class Method Summary collapse
Instance Method Summary collapse
- #apicode_info ⇒ Object
-
#initialize ⇒ Service
constructor
A new instance of Service.
- #status ⇒ Object
Constructor Details
#initialize ⇒ Service
Returns a new instance of Service.
11 12 13 |
# File 'lib/itexmo/service.rb', line 11 def initialize @api_code = Itexmo.configuration.api_code end |
Instance Attribute Details
#api_code ⇒ Object
Returns the value of attribute api_code.
7 8 9 |
# File 'lib/itexmo/service.rb', line 7 def api_code @api_code end |
Class Method Details
.apicode_info ⇒ Object
34 35 36 37 |
# File 'lib/itexmo/service.rb', line 34 def self.apicode_info instance = new instance.apicode_info end |
.status ⇒ Object
22 23 24 25 |
# File 'lib/itexmo/service.rb', line 22 def self.status instance = new instance.status end |
Instance Method Details
#apicode_info ⇒ Object
27 28 29 30 31 32 |
# File 'lib/itexmo/service.rb', line 27 def apicode_info uri = URI(API_ENDPOINT + '/apicode_info.php') uri.query = URI.encode_www_form(parameters) request = Net::HTTP.get_response(uri) ResponseHelper.parse(request.body) end |
#status ⇒ Object
15 16 17 18 19 20 |
# File 'lib/itexmo/service.rb', line 15 def status uri = URI(API_ENDPOINT + '/serverstatus.php') uri.query = URI.encode_www_form(parameters) request = Net::HTTP.get_response(uri) ResponseHelper.parse(request.body) end |