Class: Edgarj::Drawer::Base::ColumnInfoCache

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
app/helpers/edgarj/drawer/base.rb

Overview

cache ColumnInfo array per ‘controller x kind’

Instance Method Summary collapse

Constructor Details

#initializeColumnInfoCache

Returns a new instance of ColumnInfoCache.



392
393
394
395
# File 'app/helpers/edgarj/drawer/base.rb', line 392

def initialize
  #Rails.logger.debug('ColumnInfoCache initialized')
  @cache = {}
end

Instance Method Details

#cacheObject



412
413
414
# File 'app/helpers/edgarj/drawer/base.rb', line 412

def cache
  @cache
end

#presence(controller, kind) ⇒ Object

return if @cache[kind] exists



398
399
400
401
402
403
# File 'app/helpers/edgarj/drawer/base.rb', line 398

def presence(controller, kind)
  if @cache[controller].nil?
    @cache[controller] = {}
  end
  @cache[controller][kind]
end

#set(controller, kind, val) ⇒ Object



405
406
407
408
409
410
# File 'app/helpers/edgarj/drawer/base.rb', line 405

def set(controller, kind, val)
  if @cache[controller].nil?
    @cache[controller] = {}
  end
  @cache[controller][kind] = val
end