Class: Formatter::Bracketed

Inherits:
Delimited show all
Defined in:
lib/livetext/formatter.rb

Instance Method Summary collapse

Methods inherited from Delimited

#buffer, #cdata, #eol?, #escape?, #front, #grab, #handle, #initial, #looping, #marker?, process, #space?, #space_marker?, #status, #wrap

Constructor Details

#initialize(str, sigil, tag) ⇒ Bracketed

Returns a new instance of Bracketed.



186
187
188
189
190
# File 'lib/livetext/formatter.rb', line 186

def initialize(str, sigil, tag)
  super
  # Convention: marker is "*[", sigil is "*"
  @marker = sigil + "["
end

Instance Method Details

#grab_terminatorObject



196
197
198
199
# File 'lib/livetext/formatter.rb', line 196

def grab_terminator
  @state = :LOOPING
  grab
end

#terminated?Boolean

Returns:

  • (Boolean)


192
193
194
# File 'lib/livetext/formatter.rb', line 192

def terminated?
  front == "]" || eol?
end