Class: TheCity::Fund
Instance Attribute Summary
Attributes inherited from ApiObject
#error_messages, #marked_for_destruction
Class Method Summary collapse
-
.load_fund_by_id(fund_id) ⇒ Object
Loads the fund by the specified ID.
Instance Method Summary collapse
-
#initialize(reader = nil) ⇒ Fund
constructor
Constructor.
Methods inherited from ApiObject
__tc_attributes, #delete, #initialize_from_json_object, #is_deleted?, #save, #set_attributes, tc_attr_accessor, #to_attributes
Constructor Details
#initialize(reader = nil) ⇒ Fund
Constructor.
33 34 35 36 37 38 39 40 |
# File 'lib/api/fund.rb', line 33 def initialize(reader = nil) if reader.is_a?(FundReader) initialize_from_json_object(reader.load_feed) elsif reader.is_a?(Hash) initialize_from_json_object(reader) end @writer_object = FundWriter end |
Class Method Details
.load_fund_by_id(fund_id) ⇒ Object
Loads the fund by the specified ID.
Returns a new TheCity::Fund object.
23 24 25 26 |
# File 'lib/api/fund.rb', line 23 def self.load_fund_by_id(fund_id) fund_reader = FundReader.new(fund_id) self.new(fund_reader) end |