Class: ConvenientService::Support::Cache::Entities::Caches::Base
- Inherits:
-
Object
- Object
- ConvenientService::Support::Cache::Entities::Caches::Base
- Includes:
- AbstractMethod
- Defined in:
- lib/convenient_service/support/cache/entities/caches/base.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
- #key ⇒ Object readonly
- #parent ⇒ Object readonly
-
#store ⇒ Object
readonly
Returns the value of attribute store.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Boolean?
-
#[] ⇒ Object
Can be any type.
-
#[]= ⇒ Object
Can be any type.
- #clear ⇒ ConvenientService::Support::Cache::Enitities::Caches::Base
-
#default ⇒ Object
readonly
Can be any type.
-
#delete ⇒ Object?
Can be any type.
- #empty? ⇒ Boolean
- #exist? ⇒ Boolean
-
#fetch ⇒ Object
Can be any type.
-
#get ⇒ Object
Can be any type.
- #initialize(store: nil, default: nil, parent: nil, key: nil) ⇒ void constructor
- #keygen ⇒ ConvenientService::Support::Cache::Entities::Key
-
#read ⇒ Object
Can be any type.
- #scope ⇒ ConvenientService::Support::Cache::Enitities::Caches::Base
- #scope! ⇒ ConvenientService::Support::Cache::Enitities::Caches::Base
-
#set ⇒ Object
Can be any type.
-
#write ⇒ Object
Can be any type.
Methods included from AbstractMethod
Constructor Details
#initialize(store: nil, default: nil, parent: nil, key: nil) ⇒ void
110 111 112 113 114 115 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 110 def initialize(store: nil, default: nil, parent: nil, key: nil) @store = store @default = default @parent = parent @key = key end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
35 36 37 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 35 def default @default end |
#key ⇒ Object (readonly)
Note:
key
is only present when cache is scoped.
51 52 53 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 51 def key @key end |
#parent ⇒ Object (readonly)
Note:
parent
is only present when cache is scoped.
43 44 45 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 43 def parent @parent end |
#store ⇒ Object (readonly)
Returns the value of attribute store.
29 30 31 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 29 def store @store end |
Class Method Details
.keygen ⇒ ConvenientService::Support::Cache::Entities::Key
20 21 22 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 20 def keygen(...) Entities::Key.new(...) end |
Instance Method Details
#==(other) ⇒ Boolean?
168 169 170 171 172 173 174 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 168 def ==(other) return unless other.instance_of?(self.class) return false if store != other.store true end |
#[] ⇒ Object
Returns Can be any type.
130 131 132 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 130 def [](...) read(...) end |
#[]= ⇒ Object
Returns Can be any type.
150 151 152 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 150 def []=(...) write(...) end |
#clear ⇒ ConvenientService::Support::Cache::Enitities::Caches::Base
86 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 86 abstract_method :clear |
#default= ⇒ Object (readonly)
Returns Can be any type.
101 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 101 abstract_method :default= |
#delete ⇒ Object?
Returns Can be any type.
81 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 81 abstract_method :delete |
#empty? ⇒ Boolean
56 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 56 abstract_method :empty? |
#exist? ⇒ Boolean
61 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 61 abstract_method :exist? |
#fetch ⇒ Object
Returns Can be any type.
76 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 76 abstract_method :fetch |
#get ⇒ Object
Returns Can be any type.
140 141 142 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 140 def get(...) read(...) end |
#keygen ⇒ ConvenientService::Support::Cache::Entities::Key
120 121 122 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 120 def keygen(...) self.class.keygen(...) end |
#read ⇒ Object
Returns Can be any type.
66 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 66 abstract_method :read |
#scope ⇒ ConvenientService::Support::Cache::Enitities::Caches::Base
91 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 91 abstract_method :scope |
#scope! ⇒ ConvenientService::Support::Cache::Enitities::Caches::Base
96 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 96 abstract_method :scope! |
#set ⇒ Object
Returns Can be any type.
160 161 162 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 160 def set(...) write(...) end |
#write ⇒ Object
Returns Can be any type.
71 |
# File 'lib/convenient_service/support/cache/entities/caches/base.rb', line 71 abstract_method :write |