Class: TheCity::Address
Instance Attribute Summary
Attributes inherited from ApiObject
#error_messages, #marked_for_destruction
Class Method Summary collapse
-
.load_by_id(address_id) ⇒ Object
Loads the address by the specified ID.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(json_data = nil) ⇒ Address
constructor
Constructor.
- #save ⇒ Object
Methods inherited from ApiObject
__tc_attributes, #initialize_from_json_object, #is_deleted?, #set_attributes, tc_attr_accessor, #to_attributes
Constructor Details
#initialize(json_data = nil) ⇒ Address
Constructor.
36 37 38 |
# File 'lib/api/address.rb', line 36 def initialize(json_data = nil) initialize_from_json_object(json_data) unless json_data.nil? end |
Class Method Details
.load_by_id(address_id) ⇒ Object
Loads the address by the specified ID.
Returns a new TheCity::Address object.
25 26 27 28 29 30 |
# File 'lib/api/address.rb', line 25 def self.load_by_id(address_id) reader = AddressReader.new(address_id) self.new(reader.load_feed) rescue nil end |
Instance Method Details
#delete ⇒ Object
44 45 46 |
# File 'lib/api/address.rb', line 44 def delete raise 'Address does not have a delete method' end |
#save ⇒ Object
40 41 42 |
# File 'lib/api/address.rb', line 40 def save raise 'Address does not have a save method' end |