Class: FellowshipOne::Fund

Inherits:
ApiObject show all
Defined in:
lib/api/fund.rb

Instance Attribute Summary

Attributes inherited from ApiObject

#error_messages, #marked_for_destruction

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiObject

__f1_attributes, #_default_result_key, #_field_map, f1_attr_accessor, #initialize_from_json_object, #save, #set_attributes, #to_attributes

Constructor Details

#initialize(reader = nil) ⇒ Fund

Constructor.

Parameters:

  • reader (optional) (defaults to: nil)

    The object that has the data. This can be a FundReader or Hash object.



30
31
32
33
34
35
36
# File 'lib/api/fund.rb', line 30

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

Class Method Details

.load_by_id(fund_id) ⇒ Object

Load the fund by the specified ID.

Returns a new Fund object.

Parameters:

  • fund_id

    The ID of the fund to load.



22
23
24
25
# File 'lib/api/fund.rb', line 22

def self.load_by_id(fund_id)
  reader = FundReader.new(fund_id)
  self.new(reader)
end