Sha256: b96aa512ea67c83701f54cefe732340c2faf331b285a4eeaa9cce84ee22ecb46
Contents?: true
Size: 820 Bytes
Versions: 19
Compression:
Stored size: 820 Bytes
Contents
module Spec module Rails module Example class AssignsHashProxy #:nodoc: def initialize(object) @object = object end def [](ivar) if assigns.include?(ivar.to_s) assigns[ivar.to_s] elsif assigns.include?(ivar) assigns[ivar] else nil end end def []=(ivar, val) @object.instance_variable_set "@#{ivar}", val assigns[ivar.to_s] = val end def delete(name) assigns.delete(name.to_s) end def each(&block) assigns.each &block end def has_key?(key) assigns.key?(key.to_s) end protected def assigns @object.assigns end end end end end
Version data entries
19 entries across 19 versions & 4 rubygems