Module: Afterpay
- Defined in:
- lib/afterpay.rb,
lib/afterpay/item.rb,
lib/afterpay/error.rb,
lib/afterpay/order.rb,
lib/afterpay/client.rb,
lib/afterpay/config.rb,
lib/afterpay/address.rb,
lib/afterpay/payment.rb,
lib/afterpay/version.rb,
lib/afterpay/consumer.rb,
lib/afterpay/discount.rb,
lib/afterpay/utils/money.rb
Defined Under Namespace
Modules: Utils Classes: Address, Client, Config, Consumer, Discount, Error, ErrorMiddleware, Item, Order, Payment
Constant Summary collapse
- VERSION =
"0.1.9".freeze
Class Attribute Summary collapse
-
.config ⇒ Object
Returns the value of attribute config.
Class Method Summary collapse
-
.client ⇒ Object
Helper function for Afterpay::Client Use Afterpay.client to send receive request.
-
.configure {|config| ... } ⇒ Object
Configure block to setup configuration.
- .env ⇒ Object
Class Attribute Details
.config ⇒ Object
Returns the value of attribute config.
19 20 21 |
# File 'lib/afterpay.rb', line 19 def config @config end |
Class Method Details
.client ⇒ Object
Helper function for Afterpay::Client Use Afterpay.client to send receive request
24 25 26 |
# File 'lib/afterpay.rb', line 24 def self.client Client.new end |
.configure {|config| ... } ⇒ Object
Configure block to setup configuration
Afterpay.configure do |conf|
conf.app_id = <app_id>
conf.secret = <secret>
end
35 36 37 38 39 40 |
# File 'lib/afterpay.rb', line 35 def self.configure self.config ||= Config.new yield(config) if block_given? config.fetch_remote_config unless config.skip_remote_config config end |
.env ⇒ Object
42 43 44 |
# File 'lib/afterpay.rb', line 42 def self.env config.env end |