Class: ExtractI18n::HTMLExtractor::Match::BaseMatch

Inherits:
NodeMatch
  • Object
show all
Defined in:
lib/extract_i18n/html_extractor/match/base_match.rb

Direct Known Subclasses

AttributeMatch, PlainTextMatch

Instance Attribute Summary collapse

Attributes inherited from NodeMatch

#document, #key, #text

Instance Method Summary collapse

Methods inherited from NodeMatch

#to_s, #translation_key_object

Constructor Details

#initialize(document, node, text) ⇒ BaseMatch

Returns a new instance of BaseMatch.



7
8
9
10
# File 'lib/extract_i18n/html_extractor/match/base_match.rb', line 7

def initialize(document, node, text)
  super(document, text)
  @node = node
end

Instance Attribute Details

#nodeObject (readonly)

Returns the value of attribute node.



5
6
7
# File 'lib/extract_i18n/html_extractor/match/base_match.rb', line 5

def node
  @node
end

Instance Method Details

#replace_text!Object



12
13
14
# File 'lib/extract_i18n/html_extractor/match/base_match.rb', line 12

def replace_text!
  node.content = translation_key_object
end