Class: Bestchange::Api
- Inherits:
-
Object
- Object
- Bestchange::Api
- Defined in:
- lib/bestchange/api.rb
Constant Summary collapse
- BASE_URI =
'http://api.bestchange.ru/info.zip'
- BASE_CONNECTION =
Net::HTTP.new(URI(BASE_URI).host, URI(BASE_URI).port)
- BASE_REQUEST =
Net::HTTP::Get.new(URI(BASE_URI))
Instance Attribute Summary collapse
-
#conn ⇒ Object
readonly
Returns the value of attribute conn.
Instance Method Summary collapse
-
#initialize(conn = BASE_CONNECTION) ⇒ Api
constructor
A new instance of Api.
- #request(request = BASE_REQUEST) ⇒ Object
Constructor Details
#initialize(conn = BASE_CONNECTION) ⇒ Api
Returns a new instance of Api.
15 16 17 |
# File 'lib/bestchange/api.rb', line 15 def initialize(conn = BASE_CONNECTION) @conn = conn end |
Instance Attribute Details
#conn ⇒ Object (readonly)
Returns the value of attribute conn.
19 20 21 |
# File 'lib/bestchange/api.rb', line 19 def conn @conn end |
Instance Method Details
#request(request = BASE_REQUEST) ⇒ Object
21 22 23 |
# File 'lib/bestchange/api.rb', line 21 def request(request = BASE_REQUEST) conn.request(request) end |