class Leg::Page

Attributes

filename[RW]
steps[RW]

Public Class Methods

new(filename = "tutorial") click to toggle source
# File lib/leg/page.rb, line 5
def initialize(filename = "tutorial")
  @filename = filename
  @steps = []
  @footer_text = nil
end

Public Instance Methods

<<(step) click to toggle source
# File lib/leg/page.rb, line 11
def <<(step)
  @steps << step
  self
end
empty?() click to toggle source
# File lib/leg/page.rb, line 16
def empty?
  @steps.empty?
end
title() click to toggle source
# File lib/leg/page.rb, line 20
def title
  first_line = @steps.first ? @steps.first.text.lines.first : (@footer_text ? @footer_text.lines.first : nil)
  if first_line && first_line.start_with?("# ")
    first_line[2..-1].strip
  end
end