Class: Postsvg::Model::Program
- Inherits:
-
Object
- Object
- Postsvg::Model::Program
- Defined in:
- lib/postsvg/model/program.rb
Overview
Top-level program node. Carries DSC header (BoundingBox, Title, etc.) and the body — an ordered list of statements, each either a literal (Number/Name/String/Array/Procedure/Dictionary) or an Operator instance.
Defined Under Namespace
Classes: Header
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#header ⇒ Object
readonly
Returns the value of attribute header.
Instance Method Summary collapse
- #append(statement) ⇒ Object
- #concat(statements) ⇒ Object
-
#initialize(header: Header.new, body: []) ⇒ Program
constructor
A new instance of Program.
- #with(header: nil, body: nil) ⇒ Object
Constructor Details
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
10 11 12 |
# File 'lib/postsvg/model/program.rb', line 10 def body @body end |
#header ⇒ Object (readonly)
Returns the value of attribute header.
10 11 12 |
# File 'lib/postsvg/model/program.rb', line 10 def header @header end |
Instance Method Details
#append(statement) ⇒ Object
22 23 24 |
# File 'lib/postsvg/model/program.rb', line 22 def append(statement) Program.new(header: @header, body: @body + [statement]) end |