Class: SiebelDonations::Designation

Inherits:
Base
  • Object
show all
Defined in:
lib/siebel_donations/designation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

find, get, #initialize

Constructor Details

This class inherits a constructor from SiebelDonations::Base

Instance Attribute Details

#chartfieldObject (readonly)

Returns the value of attribute chartfield.



4
5
6
# File 'lib/siebel_donations/designation.rb', line 4

def chartfield
  @chartfield
end

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/siebel_donations/designation.rb', line 4

def description
  @description
end

#numberObject (readonly)

Returns the value of attribute number.



4
5
6
# File 'lib/siebel_donations/designation.rb', line 4

def number
  @number
end

#staff_account_idObject (readonly)

Returns the value of attribute staff_account_id.



4
5
6
# File 'lib/siebel_donations/designation.rb', line 4

def 
  @staff_account_id
end

Instance Method Details

#account_typeObject



6
7
8
# File 'lib/siebel_donations/designation.rb', line 6

def 
  @chartfield.present? ? 'Chartfield' : 'StaffAccount'
end

#balances(account_types = nil) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/siebel_donations/designation.rb', line 10

def balances( = nil)
  if @account_type == 'Chartfield'
    raise 'Balance information is not currently available for chartfields'
  else
    Balance.find(employee_ids: @staff_account_id, staff_account_types:  || 'primary').first
  end
end