Class: Filipinomemes::Compiler

Inherits:
Object
  • Object
show all
Defined in:
lib/filipinomemes/compiler.rb

Constant Summary collapse

STARTING_CODE =
"# encoding: utf-8\nrequire \"filipinomemes/core_ext\"\n".freeze

Instance Method Summary collapse

Constructor Details

#initializeCompiler

Returns a new instance of Compiler.



7
# File 'lib/filipinomemes/compiler.rb', line 7

def initialize; end

Instance Method Details

#zephyrum(code) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/filipinomemes/compiler.rb', line 11

def zephyrum(code)
  ruby2ruby = Ruby2Ruby.new
  parser = RubyParser.new
  sexp = parser.process("# encoding: utf-8\n#{code}")

  ruby_code = ruby2ruby.process(sexp)

  "#{STARTING_CODE}#{ruby_code}"
end