Class: Ecko::Plugins::Sponsor::Process

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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, )
  # Find the package through which we can donate.
  @package = ::DonationPackage.find(package_id)

  # A sponsor should always be associated with an account
  @account = 
end

Instance Attribute Details

#accountObject

Returns the value of attribute account.



12
13
14
# File 'lib/ecko/plugins/sponsor/process.rb', line 12

def 
  @account
end

#packageObject

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, )
  new(package_id, ).run
end

Instance Method Details

#runObject

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