Class: FirebaseStats::DeviceUtils
- Inherits:
-
Object
- Object
- FirebaseStats::DeviceUtils
- Defined in:
- lib/device_utils.rb
Overview
Parses the Firebase CSV file into sections
Class Method Summary collapse
-
.filter_device(device_data, platform) ⇒ Object
Filters a device list to only the requested platform.
-
.ios_device?(device_name) ⇒ Boolean
Is this device name an iOS device?.
Class Method Details
.filter_device(device_data, platform) ⇒ Object
Filters a device list to only the requested platform
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/device_utils.rb', line 13 def self.filter_device(device_data, platform) case platform when :android device_data.reject { |row| ios_device? row['Device model'] } when :ios device_data.select { |row| ios_device? row['Device model'] } else device_data end end |
.ios_device?(device_name) ⇒ Boolean
Is this device name an iOS device?
6 7 8 |
# File 'lib/device_utils.rb', line 6 def self.ios_device?(device_name) device_name.downcase.include?('iphone') or device_name.downcase.include?('ipad') or device_name.downcase.include?('ipod') end |