类 DSL::Var::Table

公共类方法

new(&block) 点击切换源代码
调用父类方法
# File ripper/tools/dsl.rb, line 48
def initialize(&block)
  super() {|tbl, arg|
    tbl.fetch(arg, &block)
  }
end

公共实例方法

add(&block) 点击切换源代码
# File ripper/tools/dsl.rb, line 60
def add(&block)
  v = new_var
  self[v] = Var.new(self, v, &block)
end
defined?(name) 点击切换源代码
# File ripper/tools/dsl.rb, line 65
def defined?(name)
  name = name.to_s
  any? {|_, v| v.var == name}
end
fetch(arg, &block) 点击切换源代码
调用父类方法
# File ripper/tools/dsl.rb, line 54
def fetch(arg, &block)
  super {
    self[arg] = Var.new(self, arg, &block)
  }
end
new_var() 点击切换源代码
# File ripper/tools/dsl.rb, line 70
def new_var
  "v#{size+1}"
end