Class: Bdz::Client
- Inherits:
-
Object
- Object
- Bdz::Client
- Defined in:
- lib/bdz/client.rb
Instance Attribute Summary collapse
-
#faraday_client ⇒ Object
readonly
Returns the value of attribute faraday_client.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize ⇒ Client
constructor
A new instance of Client.
-
#search(params = {}) ⇒ Object
client.search(=> “Пловдив”, :to_station => “София”, :date => “20/08/2012”).
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 12 13 14 |
# File 'lib/bdz/client.rb', line 7 def initialize @params = {} @faraday_client = Faraday.new(:url => Bdz::ROOT_URL) do |faraday| faraday.request :url_encoded # form-encode POST params faraday.response :logger # log requests to STDOUT faraday.adapter Faraday.default_adapter # make requests with Net::HTTP end end |
Instance Attribute Details
#faraday_client ⇒ Object (readonly)
Returns the value of attribute faraday_client.
5 6 7 |
# File 'lib/bdz/client.rb', line 5 def faraday_client @faraday_client end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'lib/bdz/client.rb', line 4 def params @params end |