Class: Marker::Phrase

Inherits:
RecursiveList show all
Defined in:
lib/marker/text.rb

Instance Method Summary collapse

Methods inherited from RecursiveList

#r, #single?, #to_a

Methods inherited from Treetop::Runtime::SyntaxNode

#present?

Instance Method Details

#awsObject



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

Returns:

  • (Boolean)


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”

Returns:

  • (Boolean)


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( options = {} )
  s = h.to_html(options)
  s << ' ' if space?
  s << r.to_html(options) if r
  s
end

#to_s(options = {}) ⇒ Object



52
53
54
55
56
57
# File 'lib/marker/text.rb', line 52

def to_s( options = {} )
  s = h.to_s(options)
  s << ' ' if space?
  s << r.to_s(options) if r
  s
end

#wsObject

– defaults ++



70
71
72
# File 'lib/marker/text.rb', line 70

def ws
  nil
end