Class: LedgerSync::Ledgers::Stripe::Client
- Defined in:
- lib/ledger_sync/ledgers/stripe/client.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(api_key:) ⇒ Client
constructor
A new instance of Client.
- #url_for(resource:) ⇒ Object
- #wrap_perform ⇒ Object
Methods inherited from Client
base_module, #base_module, base_operation_module_for, config, #ledger_attributes_to_save, #ledger_configuration, ledger_resource_type_for, ledger_resource_type_overrides, operation_class_for, #operation_for, #parse_operation_error, resource_from_ledger_type, resources, root_key, #searcher_class_for, #searcher_for, url_for
Methods included from Util::Mixins::ResourceRegisterableMixin
Methods included from Validatable
#valid?, #validate, #validate_or_fail
Constructor Details
#initialize(api_key:) ⇒ Client
Returns a new instance of Client.
11 12 13 14 15 |
# File 'lib/ledger_sync/ledgers/stripe/client.rb', line 11 def initialize( api_key: ) @api_key = api_key end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
9 10 11 |
# File 'lib/ledger_sync/ledgers/stripe/client.rb', line 9 def api_key @api_key end |
Class Method Details
.ledger_attributes_to_save ⇒ Object
31 32 33 |
# File 'lib/ledger_sync/ledgers/stripe/client.rb', line 31 def self.ledger_attributes_to_save [] end |
Instance Method Details
#url_for(resource:) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/ledger_sync/ledgers/stripe/client.rb', line 17 def url_for(resource:) DashboardURLHelper.new( resource: resource, base_url: "https://dashboard.stripe.com" ).url end |
#wrap_perform ⇒ Object
24 25 26 27 28 29 |
# File 'lib/ledger_sync/ledgers/stripe/client.rb', line 24 def wrap_perform ::Stripe.api_key = api_key yield ensure ::Stripe.api_key = nil end |