Class: Marker::Phrase
- Inherits:
-
RecursiveList
- Object
- Treetop::Runtime::SyntaxNode
- ParseNode
- RecursiveList
- Marker::Phrase
- Defined in:
- lib/marker/text.rb
Instance Method Summary collapse
- #aws ⇒ Object
-
#no_wrap? ⇒ Boolean
returns true if this phrase does not need to be wrapped in a paragraph.
-
#space? ⇒ Boolean
returns true if there was white space after the first “word”.
- #to_html(options = {}) ⇒ Object
- #to_s(options = {}) ⇒ Object
-
#ws ⇒ Object
– defaults ++.
Methods inherited from RecursiveList
Methods inherited from Treetop::Runtime::SyntaxNode
Instance Method Details
#aws ⇒ Object
74 75 76 |
# File 'lib/marker/text.rb', line 74 def aws nil end |
#no_wrap? ⇒ Boolean
returns true if this phrase does not need to be wrapped in a paragraph
65 66 67 |
# File 'lib/marker/text.rb', line 65 def no_wrap? single? and h.is_a? Template end |
#space? ⇒ Boolean
returns true if there was white space after the first “word”
60 61 62 |
# File 'lib/marker/text.rb', line 60 def space? (ws and ws.present?) or (aws and aws.present?) end |
#to_html(options = {}) ⇒ Object
45 46 47 48 49 50 |
# File 'lib/marker/text.rb', line 45 def to_html( = {} ) s = h.to_html() s << ' ' if space? s << r.to_html() if r s end |
#to_s(options = {}) ⇒ Object
52 53 54 55 56 57 |
# File 'lib/marker/text.rb', line 52 def to_s( = {} ) s = h.to_s() s << ' ' if space? s << r.to_s() if r s end |
#ws ⇒ Object
– defaults ++
70 71 72 |
# File 'lib/marker/text.rb', line 70 def ws nil end |