Module: Faturando

Defined in:
lib/faturando_api.rb,
lib/faturando_api.rb,
lib/faturando/version.rb

Overview

Version check

Defined Under Namespace

Classes: Base, Customer, Feature, FeatureValue, Plan, Project, Subscription

Constant Summary collapse

MIN_VERSION =
'2.3.4'
VERSION =
"0.1.2"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Returns the value of attribute api_key.



49
50
51
# File 'lib/faturando_api.rb', line 49

def api_key
  @api_key
end

.formatObject

Returns the value of attribute format.



49
50
51
# File 'lib/faturando_api.rb', line 49

def format
  @format
end

.project_keyObject

Returns the value of attribute project_key.



49
50
51
# File 'lib/faturando_api.rb', line 49

def project_key
  @project_key
end

.siteObject

Returns the value of attribute site.



49
50
51
# File 'lib/faturando_api.rb', line 49

def site
  @site
end

.timeoutObject

Returns the value of attribute timeout.



49
50
51
# File 'lib/faturando_api.rb', line 49

def timeout
  @timeout
end

Class Method Details

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

Yields:

  • (_self)

Yield Parameters:

  • _self (Faturando)

    the object that the method was called on



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/faturando_api.rb', line 51

def configure
  yield self

  Base.user      = api_key
  Base.password  = 'X'
  Base.timeout   = timeout unless (timeout.blank?)

  self.site ||= "https://faturan.do"
  project_base_path = site + "/projects/#{project_key}"

  Base.site = site

  Plan.site = project_base_path
  Feature.site = project_base_path
  Customer.site = project_base_path
  Subscription.site = project_base_path

  FeatureValue.site = project_base_path + "/plans/:plan_id"
end