Class: SilencerShop::User

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ User

Returns a new instance of User.



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

def initialize(options = {})
  requires!(options, :username, :password)

  @client = SilencerShop::Client.new(username: options[:username], password: options[:password])
end

Instance Method Details

#authenticated?Boolean

Returns:

  • (Boolean)


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

def authenticated?
  @client.access_token.present?
end