Module: BitsyClient

Defined in:
lib/bitsy_client.rb,
lib/bitsy_client/version.rb,
lib/bitsy_client/models/payment_depot.rb,
lib/bitsy_client/models/resource_base.rb

Defined Under Namespace

Classes: PaymentDepot, ResourceBase

Constant Summary collapse

API_VERSION =
"v1"
VERSION =
"0.3.0"

Class Method Summary collapse

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (BitsyClient)

    the object that the method was called on



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

def self.configure
  yield self if block_given?
end

.site=(val) ⇒ Object



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

def self.site=(val)
  @@site = (val.split("/") << API_VERSION).join("/")
  ResourceBase.site = @@site
end

.syncObject



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

def self.sync
  uri = URI.parse("#{self.site}/syncs")
  Net::HTTP.post_form(uri, {})
end

.truncateObject



26
27
28
29
# File 'lib/bitsy_client.rb', line 26

def self.truncate
  uri = URI.parse("#{self.site}/truncations")
  Net::HTTP.post_form(uri, {})
end