Class: ExcelTemplating::Document
- Inherits:
-
Object
- Object
- ExcelTemplating::Document
- Extended by:
- DocumentDsl
- Defined in:
- lib/excel_templating/document.rb
Overview
The base document class for an ExcelTemplating. Inherit from document to create your own ExcelTemplating that you may then use to generate Excel Spreadsheets from the template you supply.
Defined Under Namespace
Classes: DataSourceRegistry, Sheet
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
-
.document_default_styling ⇒ Hash
The default styling for the document.
-
.document_organization ⇒ String
The document organization.
-
.document_title ⇒ String
The non Dsl Methods, not expected to be used as part of the document description.
Instance Method Summary collapse
-
#initialize(data) ⇒ Document
constructor
Create a new document with given data.
-
#render(&block) ⇒ Object
Render this template.
Methods included from DocumentDsl
data_source_registry, default_styling, list_source, organization, protect_document, protected?, sheet, sheets, template, template_path, title
Constructor Details
#initialize(data) ⇒ Document
Create a new document with given data. 'all_sheets' is available to the template on each sheet. otherwise each numeric key in 'sheet_data' provides the data for that specific sheet. For example {foo: 'bar', 1 => "foo"}
45 46 47 |
# File 'lib/excel_templating/document.rb', line 45 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
59 60 61 |
# File 'lib/excel_templating/document.rb', line 59 def data @data end |
Class Method Details
.document_default_styling ⇒ Hash
Returns The default styling for the document.
37 38 39 |
# File 'lib/excel_templating/document.rb', line 37 def document_default_styling @default_styling || default_styling end |
.document_organization ⇒ String
Returns The document organization.
32 33 34 |
# File 'lib/excel_templating/document.rb', line 32 def document_organization @document_organization end |
.document_title ⇒ String
The non Dsl Methods, not expected to be used as part of the document description
27 28 29 |
# File 'lib/excel_templating/document.rb', line 27 def document_title @document_title end |
Instance Method Details
#render(&block) ⇒ Object
Render this template.
55 56 57 |
# File 'lib/excel_templating/document.rb', line 55 def render(&block) new_renderer.render(&block) end |