Class: TheCity::Pledge
Instance Attribute Summary
Attributes inherited from ApiObject
#error_messages, #marked_for_destruction
Class Method Summary collapse
-
.load_pledge_by_id(pledge_id) ⇒ Object
Loads the pledge by the specified ID.
Instance Method Summary collapse
-
#initialize(reader = nil) ⇒ Pledge
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) ⇒ Pledge
Constructor.
37 38 39 40 41 42 43 |
# File 'lib/api/pledge.rb', line 37 def initialize(reader = nil) if reader.is_a?(PledgeReader) initialize_from_json_object(reader.load_feed) elsif reader.is_a?(Hash) initialize_from_json_object(reader) end end |
Class Method Details
.load_pledge_by_id(pledge_id) ⇒ Object
Loads the pledge by the specified ID.
Returns a new TheCity::Pledge object.
27 28 29 30 |
# File 'lib/api/pledge.rb', line 27 def self.load_pledge_by_id(pledge_id) pledge_reader = PledgeReader.new(Pledge_id) self.new(pledge_reader) end |