class DeviceDetector::ModelExtractor

Public Instance Methods

call() click to toggle source
Calls superclass method DeviceDetector::MetadataExtractor#call
# File lib/device_detector/model_extractor.rb, line 5
def call
  s = super.to_s.gsub('_', ' ').strip
  s = s.gsub(/ TD$/i, '')

  return nil if s == 'Build'

  s.empty? ? nil : s
end

Private Instance Methods

metadata_string() click to toggle source
# File lib/device_detector/model_extractor.rb, line 16
def metadata_string
  String(regex_meta[:model])
end
regex() click to toggle source
# File lib/device_detector/model_extractor.rb, line 20
def regex
  @regex ||= regex_meta[:regex_model] || regex_meta[:regex]
end