class Iba::EmptyExpression

Public Instance Methods

_override_instance_variables(vars) click to toggle source
# File lib/iba.rb, line 95
def _override_instance_variables vars
  vars.each do |v|
    next if v =~ /^@_/
    instance_variable_set v, Iba::InstanceVariableExpression.new(v.to_sym)
  end
end
_override_local_variables(vars, bnd) click to toggle source
# File lib/iba.rb, line 102
def _override_local_variables vars, bnd
  vars.each do |v|
    next if v =~ /^_/
    bnd.local_variable_set "_#{v}", bnd.local_variable_get(v)
    bnd.local_variable_set v, LocalVariableExpression.new(v.to_sym)
  end
end
_parse(&blk) click to toggle source
# File lib/iba.rb, line 77
def _parse &blk
  bnd = blk.binding

  vars = bnd.local_variables
  ivars = bnd.receiver.instance_variables

  _override_instance_variables ivars

  _override_local_variables vars, bnd

  result = instance_eval(&blk)
  result = _wrap(result)

  _restore_local_variables vars, bnd

  result
end
_restore_local_variables(vars, bnd) click to toggle source
# File lib/iba.rb, line 110
def _restore_local_variables vars, bnd
  vars.each do |v|
    next if v =~ /^_/
    bnd.local_variable_set v, bnd.local_variable_get("_#{v}")
  end
end
_to_s() click to toggle source
# File lib/iba.rb, line 117
def _to_s
  ''
end