Class: ShelbyArena::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

#initialize_from_json_object

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.



27
28
29
30
31
32
33
# File 'lib/api/fund.rb', line 27

def initialize(reader = nil)
  if reader.is_a?(FundReader)    
    initialize_from_json_object(reader.load_data['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.



19
20
21
22
# File 'lib/api/fund.rb', line 19

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