Class: ShipEngine::Domain::Shipsurance

Inherits:
Object
  • Object
show all
Defined in:
lib/shipengine/domains/shipsurance.rb

Instance Method Summary collapse

Constructor Details

#initializeShipsurance

Returns a new instance of Shipsurance.



8
9
10
# File 'lib/shipengine/domains/shipsurance.rb', line 8

def initialize
  @client = ShipEngine::Client.new
end

Instance Method Details

#add_funds_to_insurance(params: {}) ⇒ Object



30
31
32
33
34
35
36
37
# File 'lib/shipengine/domains/shipsurance.rb', line 30

def add_funds_to_insurance(params: {})
  response = @client.patch(
    path: ShipEngine::Constants::PATHS.v1.shipsurance.add_funds,
    options: params
  )

  Hashie::Mash.new(response.body)
end

#connect_shipsurance_account(params: {}) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/shipengine/domains/shipsurance.rb', line 21

def (params: {})
  response = @client.post(
    path: ShipEngine::Constants::PATHS.v1.shipsurance.root,
    options: params
  )

  Hashie::Mash.new(response.body)
end

#disconnect_shipsurance_account(params: {}) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/shipengine/domains/shipsurance.rb', line 12

def (params: {})
  response = @client.delete(
    path: ShipEngine::Constants::PATHS.v1.shipsurance.root,
    options: params
  )

  Hashie::Mash.new(response.body)
end

#get_insurance_funds_balance(params: {}) ⇒ Object



39
40
41
42
43
44
45
46
# File 'lib/shipengine/domains/shipsurance.rb', line 39

def get_insurance_funds_balance(params: {})
  response = @client.get(
    path: ShipEngine::Constants::PATHS.v1.shipsurance.balance,
    options: params
  )

  Hashie::Mash.new(response.body)
end