Class: Reevoo::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/reevoo.rb

Instance Method Summary collapse

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

#productsObject



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