Class: Dune::Balanced::Bankaccount::Verification

Inherits:
Object
  • Object
show all
Defined in:
app/models/dune/balanced/bankaccount/verification.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(balanced_verification) ⇒ Verification

Returns a new instance of Verification.



9
10
11
# File 'app/models/dune/balanced/bankaccount/verification.rb', line 9

def initialize(balanced_verification)
  @source = balanced_verification
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object

Delegate instance methods to Balanced::BankAccountVerification object



26
27
28
29
30
31
32
# File 'app/models/dune/balanced/bankaccount/verification.rb', line 26

def method_missing(method, *args, &block)
  if @source.respond_to? method
    @source.public_send(method, *args, &block)
  else
    super
  end
end

Class Method Details

.find(href) ⇒ Object



5
6
7
# File 'app/models/dune/balanced/bankaccount/verification.rb', line 5

def self.find(href)
  new(::Balanced::BankAccountVerification.find(href))
end

Instance Method Details

#bank_account_hrefObject



13
14
15
# File 'app/models/dune/balanced/bankaccount/verification.rb', line 13

def 
  .href
end

#confirmObject



21
22
23
# File 'app/models/dune/balanced/bankaccount/verification.rb', line 21

def confirm
  DebitAuthorizedContributionsWorker.perform_async(contributor.id)
end

#contributorObject



17
18
19
# File 'app/models/dune/balanced/bankaccount/verification.rb', line 17

def contributor
  Dune::Balanced::Contributor.find_by(bank_account_href: )
end