Class: Dgrid::API::Workspace::Cache

Inherits:
Object
  • Object
show all
Defined in:
lib/dgrid/api/workspace.rb

Instance Method Summary collapse

Constructor Details

#initializeCache

Returns a new instance of Cache.



540
541
542
# File 'lib/dgrid/api/workspace.rb', line 540

def initialize
  @entries = {}
end

Instance Method Details

#get(type) ⇒ Object



552
553
554
# File 'lib/dgrid/api/workspace.rb', line 552

def get(type)
  @entries[type]
end

#include?(type) ⇒ Boolean

Returns:

  • (Boolean)


544
545
546
# File 'lib/dgrid/api/workspace.rb', line 544

def include?(type)
  @entries.include?(type)
end

#invalidate(type = nil) ⇒ Object



556
557
558
559
560
561
562
# File 'lib/dgrid/api/workspace.rb', line 556

def invalidate(type = nil)
  if type.nil?
    @entries = {}
  else
    @entries.delete(type)
  end
end

#store(type, value) ⇒ Object



548
549
550
# File 'lib/dgrid/api/workspace.rb', line 548

def store(type,value)
  @entries[type] = value
end