Class: Windows::Units::Recognizer::Finder
- Inherits:
-
Struct
- Object
- Struct
- Windows::Units::Recognizer::Finder
- Includes:
- Formats
- Defined in:
- lib/windows/units/recognizer.rb
Constant Summary
Constants included from Formats
Windows::Units::Recognizer::Formats::RECOGNIZERS
Instance Attribute Summary collapse
-
#el ⇒ Object
Returns the value of attribute el.
Instance Method Summary collapse
Instance Attribute Details
#el ⇒ Object
Returns the value of attribute el
47 48 49 |
# File 'lib/windows/units/recognizer.rb', line 47 def el @el end |
Instance Method Details
#run ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'lib/windows/units/recognizer.rb', line 50 def run item = RECOGNIZERS.map do |klass| recognizer = klass.new(el) recognizer.match end.compact.first raise "I don't know how to recognize this unit #{el}" unless item item end |