Class: LunchMoney::Calls::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/lunchmoney/calls/base.rb

Overview

Base class for all API call types. Containing the base methods got HTTP call types like GET / POST / PUT / DELETE as well as the general error handler

Constant Summary collapse

BASE_URL =

Base URL used for API calls

"https://dev.lunchmoney.app/v1/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key: nil) ⇒ void

Parameters:

  • api_key (String, nil) (defaults to: nil)


24
25
26
# File 'lib/lunchmoney/calls/base.rb', line 24

def initialize(api_key: nil)
  @api_key = T.let((api_key || LunchMoney.configuration.api_key), T.nilable(String))
end

Instance Attribute Details

#api_keyString? (readonly)

Returns:

  • (String, nil)


21
22
23
# File 'lib/lunchmoney/calls/base.rb', line 21

def api_key
  @api_key
end