class Fellowshipone::SubFund

Public Class Methods

format(res) click to toggle source
# File lib/fellowshipone/responses/sub_fund.rb, line 3
def self.format(res)
  return nil if res['subFunds'].nil?

  response = res['subFunds']['subFund']

  if response.is_a?(Array)
    response.map{|fund| format_fund(fund) }
  else
    format_fund(response)
  end
end
format_fund(fund) click to toggle source
# File lib/fellowshipone/responses/sub_fund.rb, line 15
def self.format_fund(fund)
  OpenStruct.new(
    id:   fund['@id'],
    name: fund['name'],
  )
end