module Crystal class Conveyors def initialize @hash = {} end def [] conveyor_name @hash[conveyor_name.to_s] ||= Crystal::Conveyor.new end def method_missing m, &block if block block.call self[m] else self[m] end end end end