Class: ChurchCommunityBuilder::Fund
- Inherits:
-
Object
- Object
- ChurchCommunityBuilder::Fund
- Defined in:
- lib/church_community_builder/response/fund.rb
Instance Attribute Summary collapse
-
#funds ⇒ Object
readonly
Returns the value of attribute funds.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ Fund
constructor
A new instance of Fund.
- #parse ⇒ Object
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
#funds ⇒ Object (readonly)
Returns the value of attribute funds.
5 6 7 |
# File 'lib/church_community_builder/response/fund.rb', line 5 def funds @funds end |
#response ⇒ Object (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
#parse ⇒ Object
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 |