module Baptize::Plugins::Variables

Public Instance Methods

fetch(name) click to toggle source
# File lib/baptize/plugins/variables.rb, line 12
def fetch(name)
  if @variables
    value = @variables[name.to_sym]
    if value.kind_of?(Proc)
      value.call
    else
      value
    end
  end
end
method_missing(sym, *args, &block) click to toggle source
Calls superclass method
# File lib/baptize/plugins/variables.rb, line 27
def method_missing(sym, *args, &block)
  if @variables && @variables[sym]
    fetch(sym)
  else
    super
  end
end
respond_to?(sym, include_priv = false) click to toggle source
Calls superclass method
# File lib/baptize/plugins/variables.rb, line 23
def respond_to?(sym, include_priv = false)
  super || (@variables && @variables[sym])
end
set(name, value) click to toggle source
# File lib/baptize/plugins/variables.rb, line 7
def set(name, value)
  @variables ||= {}
  @variables[name.to_sym] = value
end