Class: Ecko::Plugins::Sponsor::Process
- Inherits:
-
Object
- Object
- Ecko::Plugins::Sponsor::Process
- Defined in:
- lib/ecko/plugins/sponsor/process.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#package ⇒ Object
Returns the value of attribute package.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(package_id, account) ⇒ Process
constructor
Get the donation package and set it here.
-
#run ⇒ Object
This will run the gateway process based on the object set during configuration.
Constructor Details
#initialize(package_id, account) ⇒ Process
Get the donation package and set it here. If it is not found, RecordNotFound error will be raised
16 17 18 19 20 21 22 |
# File 'lib/ecko/plugins/sponsor/process.rb', line 16 def initialize(package_id, account) # Find the package through which we can donate. @package = ::DonationPackage.find(package_id) # A sponsor should always be associated with an account @account = account end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
12 13 14 |
# File 'lib/ecko/plugins/sponsor/process.rb', line 12 def account @account end |
#package ⇒ Object
Returns the value of attribute package.
12 13 14 |
# File 'lib/ecko/plugins/sponsor/process.rb', line 12 def package @package end |
Class Method Details
.run(package_id, account) ⇒ Object
49 50 51 |
# File 'lib/ecko/plugins/sponsor/process.rb', line 49 def run(package_id, account) new(package_id, account).run end |
Instance Method Details
#run ⇒ Object
This will run the gateway process based on the object set during configuration
25 26 27 |
# File 'lib/ecko/plugins/sponsor/process.rb', line 25 def run send("run_#{gateways[:run]}") end |