Class: Fig::Publish
- Inherits:
-
Object
- Object
- Fig::Publish
- Defined in:
- lib/fig/package.rb
Instance Attribute Summary collapse
-
#statements ⇒ Object
readonly
Returns the value of attribute statements.
Instance Method Summary collapse
-
#initialize(statements) ⇒ Publish
constructor
A new instance of Publish.
- #unparse(indent) ⇒ Object
Constructor Details
#initialize(statements) ⇒ Publish
Returns a new instance of Publish.
88 89 90 |
# File 'lib/fig/package.rb', line 88 def initialize(statements) @statements = statements end |
Instance Attribute Details
#statements ⇒ Object (readonly)
Returns the value of attribute statements.
86 87 88 |
# File 'lib/fig/package.rb', line 86 def statements @statements end |
Instance Method Details
#unparse(indent) ⇒ Object
92 93 94 95 96 97 |
# File 'lib/fig/package.rb', line 92 def unparse(indent) prefix = "\n#{indent}publish" body = @statements.map { |statement| statement.unparse(indent+' ') }.join("\n") suffix = "#{indent}end" return [prefix, body, suffix].join("\n") end |