Class: MobileDevices::Android
- Inherits:
-
Object
- Object
- MobileDevices::Android
- Defined in:
- lib/android.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file) ⇒ Android
constructor
A new instance of Android.
- #name(product) ⇒ Object
Constructor Details
#initialize(file) ⇒ Android
Returns a new instance of Android.
12 13 14 15 16 17 18 19 |
# File 'lib/android.rb', line 12 def initialize(file) @_lookup = {} JSON.parse(File.read(file)).each do |row| name = row[1] codename = row[2] @_lookup[codename] = name end end |
Class Method Details
.default ⇒ Object
8 9 10 |
# File 'lib/android.rb', line 8 def self.default @@_default ||= MobileDevices::Android.new(DEFAULT_DATA_FILE) end |
.search(product) ⇒ Object
25 26 27 |
# File 'lib/android.rb', line 25 def self.search(product) self.default.name(product) end |
Instance Method Details
#name(product) ⇒ Object
21 22 23 |
# File 'lib/android.rb', line 21 def name(product) @_lookup[product] end |