Class: AppleDb::Identifier
- Inherits:
-
Object
- Object
- AppleDb::Identifier
- Defined in:
- lib/apple_db.rb
Instance Method Summary collapse
Instance Method Details
#find_by_serial_number(serial_number) ⇒ Object
6 7 8 9 10 |
# File 'lib/apple_db.rb', line 6 def find_by_serial_number(serial_number) identifier = serial_number[serial_number.length - 4, serial_number.length] identifier[0] = "" if serial_number.length == 11 items.find { |item| identifier == item["identifier"] } end |