Class: Ecko::Plugins::Sponsor::Donated

Inherits:
Object
  • Object
show all
Defined in:
lib/ecko/plugins/sponsor/donated.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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 = ::.find(intent.payable_id)
  @package = ::DonationPackage.find(intent.['package_id'])
end

Instance Attribute Details

#accountObject

Returns the value of attribute account.



9
10
11
# File 'lib/ecko/plugins/sponsor/donated.rb', line 9

def 
  @account
end

#intentObject

Returns the value of attribute intent.



9
10
11
# File 'lib/ecko/plugins/sponsor/donated.rb', line 9

def intent
  @intent
end

#packageObject

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

#processObject

Just the processor.



20
21
22
# File 'lib/ecko/plugins/sponsor/donated.rb', line 20

def process
  create_donation &&  && close_intent
end