Class: Pione::PNML::PioneModel

Inherits:
Object
  • Object
show all
Defined in:
lib/pione/pnml/pione-model.rb

Instance Method Summary collapse

Instance Method Details

#indent(str, option) ⇒ Object

Return an indented version of the string. Indentation size is calculated by the optional argument :level. If the level is zero, return the string as is.

Parameters:

Options Hash (option):

  • :level (Integer)

    indentation level, this should be non-negative integer



496
497
498
499
500
# File 'lib/pione/pnml/pione-model.rb', line 496

def indent(str, option)
  str.lines.map do |line|
    ("  " * (option[:level] || 0)) + line
  end.join
end