Class: ChurchCommunityBuilder::Fund

Inherits:
Object
  • Object
show all
Defined in:
lib/church_community_builder/response/fund.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Fund

Returns a new instance of Fund.



7
8
9
10
# File 'lib/church_community_builder/response/fund.rb', line 7

def initialize(response)
  @response = response['ccb_api']['response']
  @funds    = @response['transaction_detail_types']['transaction_detail_type']
end

Instance Attribute Details

#fundsObject (readonly)

Returns the value of attribute funds.



5
6
7
# File 'lib/church_community_builder/response/fund.rb', line 5

def funds
  @funds
end

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/church_community_builder/response/fund.rb', line 5

def response
  @response
end

Instance Method Details

#parseObject



12
13
14
15
16
17
18
19
# File 'lib/church_community_builder/response/fund.rb', line 12

def parse
  @funds.map do |fund|
    OpenStruct.new(
      id: fund['id'],
      name: fund['name']
    )
  end
end