Class: Appfigures::User

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/appfigures/user.rb

Instance Method Summary collapse

Constructor Details

#initialize(username, password) ⇒ User

Returns a new instance of User.



10
11
12
# File 'lib/appfigures/user.rb', line 10

def initialize(username, password)
  @auth = {:username => username, :password => password}
end

Instance Method Details

#details(email = @auth[:username]) ⇒ Object



14
15
16
17
# File 'lib/appfigures/user.rb', line 14

def details(email=@auth[:username])
  email = URI.escape(email)
  self.class.get("/users/#{email}", {:basic_auth => @auth})
end

#products(email = @auth[:username]) ⇒ Object



19
20
21
22
# File 'lib/appfigures/user.rb', line 19

def products(email=@auth[:username])
  email = URI.escape(email)
  self.class.get("/users/#{email}/products", {:basic_auth => @auth})
end