Method: BOAST::CKernel#initialize

Defined in:
lib/BOAST/CKernel.rb

#initialize(options = {}) ⇒ CKernel

Returns a new instance of CKernel.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/BOAST/CKernel.rb', line 105

def initialize(options={})
  if options[:code] then
    @code = options[:code]
  elsif BOAST::get_chain_code
    @code = BOAST::get_output
    @code.seek(0,SEEK_END)
  else
    @code = StringIO::new
  end
  BOAST::set_output( @code )
  if options[:kernels] then
    @kernels = options[:kernels]
  else
    @kernels  = []
  end
  if options[:lang] then
    @lang = options[:lang]
  else
    @lang = BOAST::get_lang
  end
end