Class: EposNowClient::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/epos_now_client/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key: nil, api_secret: nil, base_url: nil) ⇒ Client

Returns a new instance of Client.



7
8
9
10
# File 'lib/epos_now_client/client.rb', line 7

def initialize(api_key: nil, api_secret: nil, base_url: nil, **)
  @configuration = build_configuration(api_key, api_secret, base_url, **)
  @connection = Connection.new(@configuration)
end

Instance Attribute Details

#configurationObject (readonly)

Returns the value of attribute configuration.



5
6
7
# File 'lib/epos_now_client/client.rb', line 5

def configuration
  @configuration
end

#connectionObject (readonly)

Returns the value of attribute connection.



5
6
7
# File 'lib/epos_now_client/client.rb', line 5

def connection
  @connection
end

Instance Method Details

#brandsObject



44
45
46
# File 'lib/epos_now_client/client.rb', line 44

def brands
  @brands ||= Resources::Brands.new(connection)
end

#categoriesObject



12
13
14
# File 'lib/epos_now_client/client.rb', line 12

def categories
  @categories ||= Resources::Categories.new(connection)
end

#customersObject



32
33
34
# File 'lib/epos_now_client/client.rb', line 32

def customers
  @customers ||= Resources::Customers.new(connection)
end

#devicesObject



40
41
42
# File 'lib/epos_now_client/client.rb', line 40

def devices
  @devices ||= Resources::Devices.new(connection)
end

#locationsObject



48
49
50
# File 'lib/epos_now_client/client.rb', line 48

def locations
  @locations ||= Resources::Locations.new(connection)
end

#productsObject



16
17
18
# File 'lib/epos_now_client/client.rb', line 16

def products
  @products ||= Resources::Products.new(connection)
end

#staffObject



36
37
38
# File 'lib/epos_now_client/client.rb', line 36

def staff
  @staff ||= Resources::Staff.new(connection)
end

#tax_groupsObject



28
29
30
# File 'lib/epos_now_client/client.rb', line 28

def tax_groups
  @tax_groups ||= Resources::TaxGroups.new(connection)
end

#tender_typesObject



24
25
26
# File 'lib/epos_now_client/client.rb', line 24

def tender_types
  @tender_types ||= Resources::TenderTypes.new(connection)
end

#transactionsObject



20
21
22
# File 'lib/epos_now_client/client.rb', line 20

def transactions
  @transactions ||= Resources::Transactions.new(connection)
end