Class: Semlogr::Templates::TextToken
- Inherits:
-
Object
- Object
- Semlogr::Templates::TextToken
- Defined in:
- lib/semlogr/templates/text_token.rb
Constant Summary collapse
- EMPTY =
TextToken.new('')
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(text) ⇒ TextToken
constructor
A new instance of TextToken.
- #render(output, _properties) ⇒ Object
Constructor Details
#initialize(text) ⇒ TextToken
Returns a new instance of TextToken.
6 7 8 |
# File 'lib/semlogr/templates/text_token.rb', line 6 def initialize(text) @text = text end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
4 5 6 |
# File 'lib/semlogr/templates/text_token.rb', line 4 def text @text end |
Instance Method Details
#==(other) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/semlogr/templates/text_token.rb', line 14 def ==(other) return false unless other return false unless other.respond_to?(:text) @text == other.text end |
#eql?(other) ⇒ Boolean
21 22 23 |
# File 'lib/semlogr/templates/text_token.rb', line 21 def eql?(other) self == other end |
#hash ⇒ Object
25 26 27 |
# File 'lib/semlogr/templates/text_token.rb', line 25 def hash @text.hash end |
#render(output, _properties) ⇒ Object
10 11 12 |
# File 'lib/semlogr/templates/text_token.rb', line 10 def render(output, _properties) output << @text end |