Class: Fig::Publish

Inherits:
Object
  • Object
show all
Defined in:
lib/fig/package.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#statementsObject (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