Class: Proforma::Document
- Inherits:
-
Object
- Object
- Proforma::Document
- Defined in:
- lib/proforma/document.rb
Overview
A rendering engine will output one or more of these objects. It is the final realization of the compilation + rendering process.
Instance Attribute Summary collapse
-
#contents ⇒ Object
readonly
Returns the value of attribute contents.
-
#extension ⇒ Object
readonly
Returns the value of attribute extension.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
-
#initialize(contents: nil, extension: '', title: '') ⇒ Document
constructor
A new instance of Document.
Constructor Details
#initialize(contents: nil, extension: '', title: '') ⇒ Document
Returns a new instance of Document.
18 19 20 21 22 23 24 |
# File 'lib/proforma/document.rb', line 18 def initialize(contents: nil, extension: '', title: '') @contents = contents @extension = extension @title = title freeze end |
Instance Attribute Details
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
16 17 18 |
# File 'lib/proforma/document.rb', line 16 def contents @contents end |
#extension ⇒ Object (readonly)
Returns the value of attribute extension.
16 17 18 |
# File 'lib/proforma/document.rb', line 16 def extension @extension end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
16 17 18 |
# File 'lib/proforma/document.rb', line 16 def title @title end |
Instance Method Details
#==(other) ⇒ Object
34 35 36 |
# File 'lib/proforma/document.rb', line 34 def ==(other) eql?(other) end |
#eql?(other) ⇒ Boolean
26 27 28 29 30 31 32 |
# File 'lib/proforma/document.rb', line 26 def eql?(other) return false unless other.is_a?(self.class) contents == other.contents && extension == other.extension && title == other.title end |