Class: TheCity::Barcode
Instance Attribute Summary
Attributes inherited from ApiObject
#error_messages, #marked_for_destruction
Class Method Summary collapse
-
.load_by_id(barcode_id) ⇒ Object
Loads the barocde by the specified ID.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(json_data = nil) ⇒ Barcode
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) ⇒ Barcode
Constructor.
27 28 29 |
# File 'lib/api/barcode.rb', line 27 def initialize(json_data = nil) initialize_from_json_object(json_data) unless json_data.nil? end |
Class Method Details
.load_by_id(barcode_id) ⇒ Object
Loads the barocde by the specified ID.
Returns a new TheCity::Barcode object.
16 17 18 19 20 21 |
# File 'lib/api/barcode.rb', line 16 def self.load_by_id() reader = BarcodeReader.new() self.new(reader.load_feed) rescue nil end |
Instance Method Details
#delete ⇒ Object
35 36 37 |
# File 'lib/api/barcode.rb', line 35 def delete raise 'Barcode does not have a delete method' end |
#save ⇒ Object
31 32 33 |
# File 'lib/api/barcode.rb', line 31 def save raise 'Barcode does not have a save method' end |