Class: Conflow::Redis::RawValueField Private
- Defined in:
- lib/conflow/redis/raw_value_field.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents single value (Redis String). Values are not serialized
Instance Attribute Summary
Attributes inherited from Field
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
private
True if equal.
-
#overwrite(value) ⇒ String
private
Redis response.
-
#to_s ⇒ String?
(also: #to_str)
private
String representation of value.
-
#value ⇒ Object
private
Value present in Redis.
Methods inherited from Field
Constructor Details
This class inherits a constructor from Conflow::Redis::Field
Instance Method Details
#==(other) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns true if equal.
21 22 23 24 25 26 27 |
# File 'lib/conflow/redis/raw_value_field.rb', line 21 def ==(other) case other when String, Symbol then value == other.to_s when RawValueField then key == other.key || to_s == other.to_s else super end end |
#overwrite(value) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns Redis response.
10 11 12 |
# File 'lib/conflow/redis/raw_value_field.rb', line 10 def overwrite(value) command :set, [key, value] end |
#to_s ⇒ String? Also known as: to_str
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns String representation of value.
15 16 17 |
# File 'lib/conflow/redis/raw_value_field.rb', line 15 def to_s value&.to_s end |
#value ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns Value present in Redis.
30 31 32 |
# File 'lib/conflow/redis/raw_value_field.rb', line 30 def value command(:get, [key]) end |