Module: Akatus

Extended by:
Akatus
Included in:
Akatus
Defined in:
lib/akatus.rb,
lib/akatus/base.rb,
lib/akatus/order.rb,
lib/akatus/phone.rb,
lib/akatus/address.rb,
lib/akatus/product.rb,
lib/akatus/version.rb,
lib/akatus/credit_card.rb,
lib/akatus/installments.rb,
lib/akatus/transactions.rb,
lib/akatus/payment_methods.rb

Defined Under Namespace

Classes: Address, CreditCard, Installments, InvalidEnvironment, MissingConfiguration, Order, PaymentMethods, Phone, Product, Transactions

Constant Summary collapse

VERSION =
"0.0.1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#config_fileObject

Returns the value of attribute config_file.



8
9
10
# File 'lib/akatus/base.rb', line 8

def config_file
  @config_file
end

#envObject

Returns the value of attribute env.



8
9
10
# File 'lib/akatus/base.rb', line 8

def env
  @env
end

Instance Method Details

#akatus_api_uriObject



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

def akatus_api_uri
  akatus_uri + "/api/v1"
end

#akatus_uriObject



26
27
28
# File 'lib/akatus/base.rb', line 26

def akatus_uri
  config["uri"]
end

#configObject



10
11
12
13
# File 'lib/akatus/base.rb', line 10

def config
  validate!
  @config ||= YAML.load_file(config_file)[env]
end

#config!Object



15
16
17
18
# File 'lib/akatus/base.rb', line 15

def config!
  @config = nil
  config
end

#seller_api_keyObject



23
24
25
# File 'lib/akatus/base.rb', line 23

def seller_api_key
  config["api_key"]
end

#seller_emailObject



20
21
22
# File 'lib/akatus/base.rb', line 20

def seller_email
  config["email"]
end