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

#contentObject



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

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

#reloadObject



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

def reload
  @content = nil
  @text    = nil
end

#textObject



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

def text
  @text ||= File.read(File.join(@dirname, 'Text.txt'))
end

#to_htmlObject



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

def to_html
  Exporter.new(content).to_html
end