Parent

Earthquake::IdVar::Gen

Public Class Methods

new(vars = "aa".."zz", prefix = "$") click to toggle source
# File lib/earthquake/id_var.rb, line 14
def initialize(vars = "aa".."zz", prefix = "$")
  unless Range === vars and String === vars.first
    raise ArgumentError, "vars should be a Range of String"
  end
  @vars = vars
  @var = @vars.last.dup
  @table = ActiveSupport::Cache::MemoryStore.new
  @prefix = prefix
end

Public Instance Methods

id2var(id) click to toggle source
# File lib/earthquake/id_var.rb, line 28
def id2var(id)
  @table.read(id) || succ(id)
end
var2id(var) click to toggle source
# File lib/earthquake/id_var.rb, line 24
def var2id(var)
  @table.read(var)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.