Class: Reevoo::Client
- Inherits:
-
Object
- Object
- Reevoo::Client
- Defined in:
- lib/reevoo.rb
Instance Method Summary collapse
-
#initialize(trkref, password) ⇒ Client
constructor
A new instance of Client.
- #products ⇒ Object
Constructor Details
#initialize(trkref, password) ⇒ Client
Returns a new instance of Client.
7 8 9 |
# File 'lib/reevoo.rb', line 7 def initialize(trkref, password) @connection = Faraday::Connection.new "http://#{trkref}:#{password}@api.reevoo.com/#{trkref}/" end |
Instance Method Details
#products ⇒ Object
11 12 13 14 15 16 |
# File 'lib/reevoo.rb', line 11 def products resp = @connection.get 'product_review_summary.xml' hash = Crack::XML.parse(resp.body) mash = Hashie::Mash.new(hash) products = mash.first[1].first[1] end |