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

Bracketed



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

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

Instance Method Details

#grab_terminatorObject



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

def grab_terminator
  @state = :LOOPING
  grab
end

#terminated?Boolean

Returns:

  • (Boolean)


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

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