Sha256: 4b60fd9900740c36010e8e2949f447ca0f73e039d3c059836ac123c4c148a9d3

Contents?: true

Size: 1.03 KB

Versions: 8

Compression:

Stored size: 1.03 KB

Contents

module FellowshipOne

  class Fund < ApiObject

    f1_attr_accessor :id,
                     :name,
                     :fund_type,
                     :fund_code,
                     :is_web_enabled,
                     :account_reference,
                     :is_active,
                     :created_date,
                     :created_by_person,
                     :last_updated_date,
                     :last_updated_by_person

    # Load the fund by the specified ID.
    #
    # @param fund_id The ID of the fund to load.
    #
    # Returns a new Fund object.
    def self.load_by_id(fund_id)
      reader = FundReader.new(fund_id)
      self.new(reader)
    end

    # Constructor.
    #
    # @param reader (optional) The object that has the data. This can be a FundReader or Hash object.
    def initialize(reader = nil)
      if reader.is_a?(FundReader)    
        initialize_from_json_object(reader.load_feed['fund'])
      elsif reader.is_a?(Hash)        
        initialize_from_json_object(reader)
      end
    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fellowshipone-api-0.9.0 lib/api/fund.rb
fellowshipone-api-0.8.0 lib/api/fund.rb
fellowshipone-api-0.7.0 lib/api/fund.rb
fellowshipone-api-0.6.4 lib/api/fund.rb
fellowshipone-api-0.6.3 lib/api/fund.rb
fellowshipone-api-0.6.2 lib/api/fund.rb
fellowshipone-api-0.6.1 lib/api/fund.rb
fellowshipone-api-0.6.0 lib/api/fund.rb