Class: Stripe2QB::Configuration
- Inherits:
-
Object
- Object
- Stripe2QB::Configuration
- Includes:
- OptionsReading
- Defined in:
- lib/stripe2qb/configuration.rb
Instance Attribute Summary collapse
-
#quickbooks_api ⇒ Object
readonly
Returns the value of attribute quickbooks_api.
-
#stripe_api ⇒ Object
readonly
Returns the value of attribute stripe_api.
Instance Method Summary collapse
-
#initialize(options) ⇒ Configuration
constructor
A new instance of Configuration.
- #process(start_date, end_date = nil) ⇒ Object
Methods included from OptionsReading
#get_required_from_options, #set_attribute_from_options
Constructor Details
#initialize(options) ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/stripe2qb/configuration.rb', line 13 def initialize() if .is_a?(String) file = File.open() = YAML.load(file.read) end = ('quickbooks_api', ) @quickbooks_api = QuickbooksApi.new() = ('stripe_api', ) @stripe_api = StripeApi.new() end |
Instance Attribute Details
#quickbooks_api ⇒ Object (readonly)
Returns the value of attribute quickbooks_api.
10 11 12 |
# File 'lib/stripe2qb/configuration.rb', line 10 def quickbooks_api @quickbooks_api end |
#stripe_api ⇒ Object (readonly)
Returns the value of attribute stripe_api.
11 12 13 |
# File 'lib/stripe2qb/configuration.rb', line 11 def stripe_api @stripe_api end |
Instance Method Details
#process(start_date, end_date = nil) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/stripe2qb/configuration.rb', line 26 def process(start_date, end_date = nil) transfers = stripe_api.get_transfers(start_date, end_date || Date.today) transfers.each do |transfer| Converters::TransferToDeposit.new(transfer, self).find_or_create end end |