Class: Minisky::User

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

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ User

Returns a new instance of User.



12
13
14
# File 'lib/minisky/requests.rb', line 12

def initialize(config)
  @config = config
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/minisky/requests.rb', line 20

def method_missing(name, *args)
  if name.end_with?('=')
    @config[name.to_s.chop] = args[0]
  else
    @config[name.to_s]
  end
end

Instance Method Details

#logged_in?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/minisky/requests.rb', line 16

def logged_in?
  !!(access_token && refresh_token)
end