File: name_extractor.rb

package info (click to toggle)
ruby-device-detector 1.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,820 kB
  • sloc: ruby: 3,650; makefile: 5
file content (19 lines) | stat: -rw-r--r-- 303 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class DeviceDetector
  class NameExtractor < MetadataExtractor
    def call
      if /\$[0-9]/ =~ metadata_string
        extract_metadata
      else
        metadata_string
      end
    end

    private

    def metadata_string
      regex_meta[:name]
    end
  end
end