Class: Ecko::Plugins::Sponsor::Donated
- Inherits:
-
Object
- Object
- Ecko::Plugins::Sponsor::Donated
- Defined in:
- lib/ecko/plugins/sponsor/donated.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#intent ⇒ Object
Returns the value of attribute intent.
-
#package ⇒ Object
Returns the value of attribute package.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(intent) ⇒ Donated
constructor
Sets the intent of the donation and finds account and package with whom the intent is related to.
-
#process ⇒ Object
Just the processor.
Constructor Details
#initialize(intent) ⇒ Donated
Sets the intent of the donation and finds account and package with whom the intent is related to.
13 14 15 16 17 |
# File 'lib/ecko/plugins/sponsor/donated.rb', line 13 def initialize(intent) @intent = intent @account = ::Account.find(intent.payable_id) @package = ::DonationPackage.find(intent.['package_id']) end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
9 10 11 |
# File 'lib/ecko/plugins/sponsor/donated.rb', line 9 def account @account end |
#intent ⇒ Object
Returns the value of attribute intent.
9 10 11 |
# File 'lib/ecko/plugins/sponsor/donated.rb', line 9 def intent @intent end |
#package ⇒ Object
Returns the value of attribute package.
9 10 11 |
# File 'lib/ecko/plugins/sponsor/donated.rb', line 9 def package @package end |
Class Method Details
.process(intent) ⇒ Object
42 43 44 |
# File 'lib/ecko/plugins/sponsor/donated.rb', line 42 def process(intent) new(intent).process end |
Instance Method Details
#process ⇒ Object
Just the processor.
20 21 22 |
# File 'lib/ecko/plugins/sponsor/donated.rb', line 20 def process create_donation && update_account_sponsorship && close_intent end |