Class: Ulysses::Sheet

Inherits:
Object
  • Object
show all
Defined in:
lib/ulysses/sheet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dirname) ⇒ Sheet

Returns a new instance of Sheet.



6
7
8
# File 'lib/ulysses/sheet.rb', line 6

def initialize(dirname)
  @dirname = dirname
end

Instance Attribute Details

#dirnameObject (readonly)

Returns the value of attribute dirname.



4
5
6
# File 'lib/ulysses/sheet.rb', line 4

def dirname
  @dirname
end

Instance Method Details

#markupObject



10
11
12
# File 'lib/ulysses/sheet.rb', line 10

def markup
  @markup ||= parse_markup
end

#reloadObject



22
23
24
# File 'lib/ulysses/sheet.rb', line 22

def reload
  @markup, @xml, @html = nil
end

#to_htmlObject



18
19
20
# File 'lib/ulysses/sheet.rb', line 18

def to_html
  @html ||= Exporter.new(xml).to_html
end

#xmlObject



14
15
16
# File 'lib/ulysses/sheet.rb', line 14

def xml
  @xml ||=  Nokogiri::XML(File.read(File.join(@dirname, 'Content.xml')))
end