Class: RDB::ReaderState
- Inherits:
-
Object
- Object
- RDB::ReaderState
- Defined in:
- lib/rdb/reader-state.rb
Instance Attribute Summary collapse
-
#callbacks ⇒ Object
readonly
Returns the value of attribute callbacks.
-
#database ⇒ Object
Returns the value of attribute database.
-
#info ⇒ Object
Returns the value of attribute info.
-
#key ⇒ Object
Returns the value of attribute key.
-
#key_expiration ⇒ Object
Returns the value of attribute key_expiration.
-
#key_type_id ⇒ Object
Returns the value of attribute key_type_id.
Instance Method Summary collapse
-
#initialize(callbacks = nil) ⇒ ReaderState
constructor
A new instance of ReaderState.
- #key_expires? ⇒ Boolean
- #key_type ⇒ Object
Constructor Details
#initialize(callbacks = nil) ⇒ ReaderState
Returns a new instance of ReaderState.
7 8 9 |
# File 'lib/rdb/reader-state.rb', line 7 def initialize(callbacks = nil) @callbacks = callbacks || EmptyCallbacks.new end |
Instance Attribute Details
#callbacks ⇒ Object (readonly)
Returns the value of attribute callbacks.
5 6 7 |
# File 'lib/rdb/reader-state.rb', line 5 def callbacks @callbacks end |
#database ⇒ Object
Returns the value of attribute database.
3 4 5 |
# File 'lib/rdb/reader-state.rb', line 3 def database @database end |
#info ⇒ Object
Returns the value of attribute info.
3 4 5 |
# File 'lib/rdb/reader-state.rb', line 3 def info @info end |
#key ⇒ Object
Returns the value of attribute key.
4 5 6 |
# File 'lib/rdb/reader-state.rb', line 4 def key @key end |
#key_expiration ⇒ Object
Returns the value of attribute key_expiration.
4 5 6 |
# File 'lib/rdb/reader-state.rb', line 4 def key_expiration @key_expiration end |
#key_type_id ⇒ Object
Returns the value of attribute key_type_id.
4 5 6 |
# File 'lib/rdb/reader-state.rb', line 4 def key_type_id @key_type_id end |
Instance Method Details
#key_expires? ⇒ Boolean
11 12 13 |
# File 'lib/rdb/reader-state.rb', line 11 def key_expires? !@key_expiration.nil? end |
#key_type ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/rdb/reader-state.rb', line 15 def key_type case @key_type_id when Type::STRING then :string when Type::SET, Type::SET_INTSET then :set when Type::LIST, Type::LIST_ZIPLIST then :list when Type::ZSET, Type::ZSET_ZIPLIST then :sortedset when Type::HASH, Type::HASH_ZIPMAP, Type::HASH_ZIPLIST then :hash end end |