Class: Portable::Document
- Inherits:
-
Object
- Object
- Portable::Document
- Includes:
- Util::Pivotable, Util::Uniqueness
- Defined in:
- lib/portable/document.rb
Overview
Top-level object model for a renderable document.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(sheets: [], options: {}) ⇒ Document
constructor
A new instance of Document.
- #sheet(name) ⇒ Object
- #sheets ⇒ Object
Methods included from Util::Uniqueness
Methods included from Util::Pivotable
Constructor Details
#initialize(sheets: [], options: {}) ⇒ Document
Returns a new instance of Document.
22 23 24 25 26 27 |
# File 'lib/portable/document.rb', line 22 def initialize(sheets: [], options: {}) @sheets_by_name = make_unique_sheets_by_name(sheets) @options = Modeling::Options.make(, nullable: false) freeze end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
20 21 22 |
# File 'lib/portable/document.rb', line 20 def @options end |
Instance Method Details
#sheet(name) ⇒ Object
29 30 31 |
# File 'lib/portable/document.rb', line 29 def sheet(name) sheets_by_name.fetch(name.to_s) end |
#sheets ⇒ Object
33 34 35 |
# File 'lib/portable/document.rb', line 33 def sheets sheets_by_name.values end |