Class: ExtractI18n::HTMLExtractor::Match::NodeMatch
- Inherits:
-
Object
- Object
- ExtractI18n::HTMLExtractor::Match::NodeMatch
- Defined in:
- lib/extract_i18n/html_extractor/match/node_match.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
- #key ⇒ Object
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(document, text) ⇒ NodeMatch
constructor
A new instance of NodeMatch.
- #replace_text! ⇒ Object
- #translation_key_object ⇒ Object
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 (readonly)
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
22 23 24 |
# File 'lib/extract_i18n/html_extractor/match/node_match.rb', line 22 def key @key ||= text.parameterize.underscore end |
#text ⇒ Object (readonly)
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 |
#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 |