Class: TwitterCldr::Transforms::RuleMatch

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_cldr/transforms/rule_match.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rule, side_match) ⇒ RuleMatch

Returns a new instance of RuleMatch.



11
12
13
14
# File 'lib/twitter_cldr/transforms/rule_match.rb', line 11

def initialize(rule, side_match)
  @rule = rule
  @side_match = side_match
end

Instance Attribute Details

#ruleObject (readonly)

Returns the value of attribute rule.



9
10
11
# File 'lib/twitter_cldr/transforms/rule_match.rb', line 9

def rule
  @rule
end

#side_matchObject (readonly)

Returns the value of attribute side_match.



9
10
11
# File 'lib/twitter_cldr/transforms/rule_match.rb', line 9

def side_match
  @side_match
end

Instance Method Details

#<(other_match) ⇒ Object



32
33
34
# File 'lib/twitter_cldr/transforms/rule_match.rb', line 32

def <(other_match)
  rule.index < other_match.rule.index
end

#cursor_offsetObject



28
29
30
# File 'lib/twitter_cldr/transforms/rule_match.rb', line 28

def cursor_offset
  rule.cursor_offset
end

#replacementObject



24
25
26
# File 'lib/twitter_cldr/transforms/rule_match.rb', line 24

def replacement
  rule.replacement_for(side_match)
end

#startObject



16
17
18
# File 'lib/twitter_cldr/transforms/rule_match.rb', line 16

def start
  side_match.start
end

#stopObject



20
21
22
# File 'lib/twitter_cldr/transforms/rule_match.rb', line 20

def stop
  side_match.stop
end