Class: Mintsoft::Client

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

Constant Summary collapse

BASE_URL =
"https://api.mintsoft.co.uk"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token:, base_url: BASE_URL, conn_opts: {}) ⇒ Client

Returns a new instance of Client.



12
13
14
15
16
# File 'lib/mintsoft/client.rb', line 12

def initialize(token:, base_url: BASE_URL, conn_opts: {})
  @token = token
  @base_url = base_url
  @conn_opts = conn_opts
end

Instance Attribute Details

#base_urlObject (readonly)

Returns the value of attribute base_url.



10
11
12
# File 'lib/mintsoft/client.rb', line 10

def base_url
  @base_url
end

#conn_optsObject (readonly)

Returns the value of attribute conn_opts.



10
11
12
# File 'lib/mintsoft/client.rb', line 10

def conn_opts
  @conn_opts
end

#tokenObject (readonly)

Returns the value of attribute token.



10
11
12
# File 'lib/mintsoft/client.rb', line 10

def token
  @token
end

Instance Method Details

#connectionObject



18
19
20
# File 'lib/mintsoft/client.rb', line 18

def connection
  @connection ||= build_connection
end

#ordersObject



22
23
24
# File 'lib/mintsoft/client.rb', line 22

def orders
  @orders ||= Resources::Orders.new(self)
end

#returnsObject



26
27
28
# File 'lib/mintsoft/client.rb', line 26

def returns
  @returns ||= Resources::Returns.new(self)
end