Class: ExtractI18n::HTMLExtractor::Match::NodeMatch
- Inherits:
-
Object
- Object
- ExtractI18n::HTMLExtractor::Match::NodeMatch
show all
- Defined in:
- lib/extract_i18n/html_extractor/match/node_match.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(document, text) ⇒ NodeMatch
Returns a new instance of NodeMatch.
7
8
9
10
|
# File 'lib/extract_i18n/html_extractor/match/node_match.rb', line 7
def initialize(document, text)
@document = document
@text = text
end
|
Instance Attribute Details
#document ⇒ Object
Returns the value of attribute document.
5
6
7
|
# File 'lib/extract_i18n/html_extractor/match/node_match.rb', line 5
def document
@document
end
|
#key ⇒ Object
26
27
28
|
# File 'lib/extract_i18n/html_extractor/match/node_match.rb', line 26
def key
@key ||= text.parameterize.underscore
end
|
#text ⇒ Object
Returns the value of attribute text.
5
6
7
|
# File 'lib/extract_i18n/html_extractor/match/node_match.rb', line 5
def text
@text
end
|
Instance Method Details
#replace_text! ⇒ Object
16
17
18
|
# File 'lib/extract_i18n/html_extractor/match/node_match.rb', line 16
def replace_text!
raise NotImplementedError
end
|
#to_s ⇒ Object
20
21
22
|
# File 'lib/extract_i18n/html_extractor/match/node_match.rb', line 20
def to_s
text
end
|
#translation_key_object ⇒ Object
12
13
14
|
# File 'lib/extract_i18n/html_extractor/match/node_match.rb', line 12
def translation_key_object
"t('.#{key}')"
end
|