Class: SimpleSpreadsheets::Document
- Inherits:
-
Object
- Object
- SimpleSpreadsheets::Document
- Includes:
- Rendering
- Defined in:
- lib/simple_spreadsheets/document.rb
Defined Under Namespace
Classes: Row
Instance Attribute Summary collapse
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(title) ⇒ Document
constructor
A new instance of Document.
- #row {|row| ... } ⇒ Object
Methods included from Rendering
#render, #template, #template_file
Constructor Details
#initialize(title) ⇒ Document
Returns a new instance of Document.
13 14 15 16 |
# File 'lib/simple_spreadsheets/document.rb', line 13 def initialize(title) @title = title @rows = [] end |
Instance Attribute Details
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/simple_spreadsheets/document.rb', line 5 def title @title end |
Class Method Details
.render(title) {|instance| ... } ⇒ Object
7 8 9 10 11 |
# File 'lib/simple_spreadsheets/document.rb', line 7 def self.render(title) instance = new(title) yield instance instance.render end |
Instance Method Details
#row {|row| ... } ⇒ Object
18 19 20 21 22 |
# File 'lib/simple_spreadsheets/document.rb', line 18 def row row = Row.new yield(row) rows << row end |