Skip to content

Instantly share code, notes, and snippets.

@jamiecook
Created May 30, 2012 23:32
Show Gist options
  • Save jamiecook/2839563 to your computer and use it in GitHub Desktop.
Save jamiecook/2839563 to your computer and use it in GitHub Desktop.
[:id, :tag, :type, :type_name].each { |y|
define_method "#{object_type}_#{y}" do |id|
@object_ids ||= {}
@object_ids[[$Ot.currentVariant, object_type]] ||= self.send("get_x_to_#{y}_hash", object_type.to_sym)
if [:type,:type_name].include?(y)
rv = @object_types[object_type][nr][serie.to_serie]
return (rv.is_a?(Fixnum) || rv.is_a?(String)) ? rv : nil
else
return @object_ids[object_type][id]
end
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment