Class: CustomERB::Compiler::Buffer

Inherits:
Object
  • Object
show all
Defined in:
lib/ontomde-core/customERB.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(compiler) ⇒ Buffer

Returns a new instance of Buffer.



504
505
506
507
508
509
510
511
# File 'lib/ontomde-core/customERB.rb', line 504

def initialize(compiler)
  @compiler = compiler
  @line = []
  @script = ""
  @compiler.pre_cmd.each do |x|
    push(x)
  end
end

Instance Attribute Details

#scriptObject (readonly)

Returns the value of attribute script.



512
513
514
# File 'lib/ontomde-core/customERB.rb', line 512

def script
  @script
end

Instance Method Details

#closeObject



524
525
526
527
528
529
530
531
# File 'lib/ontomde-core/customERB.rb', line 524

def close
  return unless @line
  @compiler.post_cmd.each do |x|
    push(x)
  end
  @script << (@line.join('; '))
  @line = nil
end

#crObject



518
519
520
521
522
# File 'lib/ontomde-core/customERB.rb', line 518

def cr
  @script << (@line.join('; '))
  @line = []
  @script << "\n"
end

#push(cmd) ⇒ Object



514
515
516
# File 'lib/ontomde-core/customERB.rb', line 514

def push(cmd)
  @line << cmd
end