Class: HParser::Inline::Text
- Inherits:
-
Object
- Object
- HParser::Inline::Text
- Includes:
- Collectable
- Defined in:
- lib/hparser/html.rb,
lib/hparser/text.rb,
lib/hparser/latex.rb,
lib/hparser/hatena.rb,
lib/hparser/inline/text.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
(also: #to_text, #to_hatena)
readonly
Returns the value of attribute text.
Class Method Summary collapse
Instance Method Summary collapse
- #+(other) ⇒ Object
- #==(o) ⇒ Object
-
#initialize(text) ⇒ Text
constructor
A new instance of Text.
- #to_html ⇒ Object
- #to_latex ⇒ Object
Constructor Details
#initialize(text) ⇒ Text
Returns a new instance of Text.
23 24 25 |
# File 'lib/hparser/inline/text.rb', line 23 def initialize(text) @text = text end |
Instance Attribute Details
#text ⇒ Object (readonly) Also known as: to_text, to_hatena
Returns the value of attribute text.
10 11 12 |
# File 'lib/hparser/inline/text.rb', line 10 def text @text end |
Class Method Details
.<=>(o) ⇒ Object
12 13 14 15 |
# File 'lib/hparser/inline/text.rb', line 12 def self.<=>(o) # This parser should be last. 1 end |
Instance Method Details
#+(other) ⇒ Object
27 28 29 |
# File 'lib/hparser/inline/text.rb', line 27 def +(other) Text.new(self.text+other.text) end |
#==(o) ⇒ Object
31 32 33 |
# File 'lib/hparser/inline/text.rb', line 31 def ==(o) o.class == self.class and @text == o.text end |
#to_html ⇒ Object
287 288 289 |
# File 'lib/hparser/html.rb', line 287 def to_html self.text end |
#to_latex ⇒ Object
230 231 232 |
# File 'lib/hparser/latex.rb', line 230 def to_latex self.text end |