class Jcompiler::Cache @@store = {} def self.read(id, source) @@store[id] ||= Jcompiler::Compiler.new(source).compile File.open('/tmp/hoge', 'w') do |f| f.puts @@store[id] end @@store[id] end end