Class: Lipseys::User

Inherits:
Base
  • Object
show all
Defined in:
lib/lipseys/user.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ User

Returns a new instance of User.



4
5
6
7
# File 'lib/lipseys/user.rb', line 4

def initialize(options = {})
  requires!(options, :email, :password)
  @options = options
end

Instance Method Details

#authenticated?Boolean

Returns:

  • (Boolean)


9
10
11
12
13
14
15
# File 'lib/lipseys/user.rb', line 9

def authenticated?
  # As an auth check, just try to get invoices with a bogus order number.
  Lipseys::Invoice.all(@options.merge(order_number: 'abc'))
  true
rescue Lipseys::NotAuthenticated
  false
end