Class: Broke

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

Direct Known Subclasses

Charge, Pingback, Subscription, Token

Defined Under Namespace

Classes: Charge, Pingback, Subscription, Token

Constant Summary collapse

@@conn =
Faraday.new(:url => 'https://api.paymentwall.com/api') do |conn|
  conn.request  :url_encoded
  conn.response :json, :content_type => 'application/json'
  conn.adapter  Faraday.default_adapter
end

Instance Method Summary collapse

Constructor Details

#initialize(keys = {}) ⇒ Broke



6
7
8
9
# File 'lib/broke.rb', line 6

def initialize keys = {}
  @@public_key = keys[:public_key]
  @@private_key = keys[:private_key]
end

Instance Method Details

#chargeObject



21
22
23
# File 'lib/broke.rb', line 21

def charge
  Charge.new
end

#pingbackObject



29
30
31
# File 'lib/broke.rb', line 29

def pingback
  Pingback
end

#subscriptionObject



25
26
27
# File 'lib/broke.rb', line 25

def subscription
  Subscription.new
end

#tokenObject



17
18
19
# File 'lib/broke.rb', line 17

def token
  Token.new
end