Module: NeverBounce::API::Feature::Eigencache::InstanceMethods

Defined in:
lib/never_bounce/api/feature/eigencache.rb

Instance Method Summary collapse

Instance Method Details

#_cacheHash

Hidden cache.

def body
  _cache[:body] ||= File.read("my-bulky-body.csv")
end

def body=(v)
  _cache[:body] = v
end

Returns:

  • (Hash)


25
26
27
28
29
30
31
# File 'lib/never_bounce/api/feature/eigencache.rb', line 25

def _cache
  if eigen.instance_variable_defined?(k = :@cache)
    eigen.instance_variable_get(k)
  else
    eigen.instance_variable_set(k, {})
  end
end

#eigenClass (private)

Object’s eigenclass (singleton class).

Returns:

  • (Class)


38
39
40
# File 'lib/never_bounce/api/feature/eigencache.rb', line 38

def eigen
  class << self; self; end
end