Class: Gratitude::Client

Inherits:
Object
  • Object
show all
Includes:
Tips, Connection
Defined in:
lib/gratitude/tips.rb,
lib/gratitude/client.rb

Defined Under Namespace

Modules: Tips

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Tips

#current_tips, #current_tips_total, #update_tips, #update_tips_and_prune

Methods included from Connection

#faraday

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



13
14
15
16
17
# File 'lib/gratitude/client.rb', line 13

def initialize(options = {})
  @username = options[:username]
  @api_key = options[:api_key]
  faraday.basic_auth(api_key, "")
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



11
12
13
# File 'lib/gratitude/client.rb', line 11

def api_key
  @api_key
end

#usernameObject (readonly)

Returns the value of attribute username.



11
12
13
# File 'lib/gratitude/client.rb', line 11

def username
  @username
end