Class: Cryptohopper::Resources::Subscription

Inherits:
Object
  • Object
show all
Defined in:
lib/cryptohopper/resources/subscription.rb

Overview

‘client.subscription` — plans, per-hopper state, credits, billing.

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Subscription

Returns a new instance of Subscription.



7
8
9
# File 'lib/cryptohopper/resources/subscription.rb', line 7

def initialize(client)
  @client = client
end

Instance Method Details

#assign(data) ⇒ Object



28
29
30
# File 'lib/cryptohopper/resources/subscription.rb', line 28

def assign(data)
  @client._request("POST", "/subscription/assign", body: data)
end

#getObject



16
17
18
# File 'lib/cryptohopper/resources/subscription.rb', line 16

def get
  @client._request("GET", "/subscription/get")
end

#get_creditsObject



32
33
34
# File 'lib/cryptohopper/resources/subscription.rb', line 32

def get_credits
  @client._request("GET", "/subscription/getcredits")
end

#hopper(hopper_id) ⇒ Object



11
12
13
14
# File 'lib/cryptohopper/resources/subscription.rb', line 11

def hopper(hopper_id)
  @client._request("GET", "/subscription/hopper",
                   params: { hopper_id: hopper_id })
end

#order_sub(data) ⇒ Object



36
37
38
# File 'lib/cryptohopper/resources/subscription.rb', line 36

def order_sub(data)
  @client._request("POST", "/subscription/ordersub", body: data)
end

#plansObject



20
21
22
# File 'lib/cryptohopper/resources/subscription.rb', line 20

def plans
  @client._request("GET", "/subscription/plans")
end

#remap(data) ⇒ Object



24
25
26
# File 'lib/cryptohopper/resources/subscription.rb', line 24

def remap(data)
  @client._request("POST", "/subscription/remap", body: data)
end

#stop_subscription(data = {}) ⇒ Object



40
41
42
# File 'lib/cryptohopper/resources/subscription.rb', line 40

def stop_subscription(data = {})
  @client._request("POST", "/subscription/stopsubscription", body: data)
end