Class: FellowshipOne::Status

Inherits:
ApiObject show all
Defined in:
lib/api/status.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) ⇒ Status

Constructor.

Parameters:

  • reader (optional) (defaults to: nil)

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



21
22
23
24
25
26
27
# File 'lib/api/status.rb', line 21

def initialize(reader = nil)
  if reader.is_a?(StatusReader)
    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(status_id) ⇒ Object

Load the status by the specified ID.

Returns a new Status object.

Parameters:

  • status_id

    The ID of the status to load.



13
14
15
16
# File 'lib/api/status.rb', line 13

def self.load_by_id(status_id)
  reader = StatusReader.new(status_id)
  self.new(reader)
end