Class: Windows::Units::Recognizer::Formats::Base

Inherits:
Struct
  • Object
show all
Defined in:
lib/windows/units/recognizer.rb

Direct Known Subclasses

Percent, Pixel

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#elObject

Returns the value of attribute el

Returns:

  • (Object)

    the current value of el



5
6
7
# File 'lib/windows/units/recognizer.rb', line 5

def el
  @el
end

#unitObject

Returns the value of attribute unit.



6
7
8
# File 'lib/windows/units/recognizer.rb', line 6

def unit
  @unit
end

Instance Method Details

#formatObject



12
13
14
# File 'lib/windows/units/recognizer.rb', line 12

def format
  self.class.to_s.split("::").last.downcase.to_sym
end

#matchObject



8
9
10
# File 'lib/windows/units/recognizer.rb', line 8

def match
  raise "you should implement your match"
end

#return_match(matcher, data, &block) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/windows/units/recognizer.rb', line 16

def return_match(matcher, data,&block)
  data = if data
    matcher.instance_eval &block
    matcher
  else
    nil
  end
end