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.
8 9 10 |
# File 'lib/semlogr/templates/text_token.rb', line 8 def initialize(text) @text = text end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
6 7 8 |
# File 'lib/semlogr/templates/text_token.rb', line 6 def text @text end |
Instance Method Details
#==(other) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/semlogr/templates/text_token.rb', line 16 def ==(other) return false unless other return false unless other.respond_to?(:text) @text == other.text end |
#eql?(other) ⇒ Boolean
23 24 25 |
# File 'lib/semlogr/templates/text_token.rb', line 23 def eql?(other) self == other end |
#hash ⇒ Object
27 28 29 |
# File 'lib/semlogr/templates/text_token.rb', line 27 def hash @text.hash end |
#render(output, _properties) ⇒ Object
12 13 14 |
# File 'lib/semlogr/templates/text_token.rb', line 12 def render(output, _properties) output << @text end |