# File lib/slim/logic_less/context.rb, line 79 def [](name) @lookup.each do |lookup| case lookup when :method return @dict.send(name) if @dict.respond_to?(name) when :symbol return @dict[name] if has_key?(name) when :string return @dict[name.to_s] if has_key?(name.to_s) when :instance_variable var_name = "@#{name}" return @dict.instance_variable_get(var_name) if instance_variable?(var_name) end end @parent[name] if @parent end
# File lib/slim/logic_less/context.rb, line 62 def lambda(name, &block) @lookup.each do |lookup| case lookup when :method return @dict.send(name, &block) if @dict.respond_to?(name) when :symbol return @dict[name].call(&block) if has_key?(name) when :string return @dict[name.to_s].call(&block) if has_key?(name.to_s) when :instance_variable var_name = "@#{name}" return @dict.instance_variable_get(var_name).call(&block) if instance_variable?(var_name) end end @parent.lambda(name) if @parent end
Generated with the Darkfish Rdoc Generator 2.