Class: Rbml::Procedural

Inherits:
Base
  • Object
show all
Defined in:
lib/procedural.rb

Instance Attribute Summary

Attributes inherited from Base

#dsl

Class Method Summary collapse

Methods inherited from Base

#initialize, #instance_eval_each

Constructor Details

This class inherits a constructor from Rbml::Base

Class Method Details

.render(language, options, &block) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/procedural.rb', line 3

def self.render(language, options, &block)
  d = Procedural.new(language)
  display = lambda do |result|
      puts "#{result}\n" unless result.nil?
    end
  loop do
    d.instance_eval_each(block, &display)
    stdin = IO.new(0, "w+")
    d.dsl.__send__("call", stdin.gets.chomp)
  end
end