Class: Ulysses::Sheet
- Inherits:
-
Object
- Object
- Ulysses::Sheet
- Defined in:
- lib/ulysses/sheet.rb
Instance Attribute Summary collapse
-
#dirname ⇒ Object
readonly
Returns the value of attribute dirname.
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(dirname) ⇒ Sheet
constructor
A new instance of Sheet.
- #reload ⇒ Object
- #text ⇒ Object
- #to_html ⇒ Object
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
#dirname ⇒ Object (readonly)
Returns the value of attribute dirname.
4 5 6 |
# File 'lib/ulysses/sheet.rb', line 4 def dirname @dirname end |
Instance Method Details
#content ⇒ Object
15 16 17 |
# File 'lib/ulysses/sheet.rb', line 15 def content @content ||= File.read(File.join(@dirname, 'Content.xml')) end |
#reload ⇒ Object
10 11 12 13 |
# File 'lib/ulysses/sheet.rb', line 10 def reload @content = nil @text = nil end |
#text ⇒ Object
19 20 21 |
# File 'lib/ulysses/sheet.rb', line 19 def text @text ||= File.read(File.join(@dirname, 'Text.txt')) end |
#to_html ⇒ Object
23 24 25 |
# File 'lib/ulysses/sheet.rb', line 23 def to_html Exporter.new(content).to_html end |