Class: ConvenientService::Support::Cache::Entities::Key
- Inherits:
-
Object
- Object
- ConvenientService::Support::Cache::Entities::Key
- Defined in:
- lib/convenient_service/support/cache/entities/key.rb
Instance Method Summary collapse
- #==(other) ⇒ Boolean
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
- #initialize(*args, **kwargs, &block) ⇒ void constructor
Constructor Details
#initialize(*args, **kwargs, &block) ⇒ void
14 15 16 17 18 |
# File 'lib/convenient_service/support/cache/entities/key.rb', line 14 def initialize(*args, **kwargs, &block) @args = args @kwargs = kwargs @block = block end |
Instance Method Details
#==(other) ⇒ Boolean
24 25 26 27 28 29 30 31 32 |
# File 'lib/convenient_service/support/cache/entities/key.rb', line 24 def ==(other) return unless other.instance_of?(self.class) return false if args != other.args return false if kwargs != other.kwargs return false if block&.source_location != other.block&.source_location true end |
#eql?(other) ⇒ Boolean
63 64 65 66 67 |
# File 'lib/convenient_service/support/cache/entities/key.rb', line 63 def eql?(other) return unless other.instance_of?(self.class) hash == other.hash end |
#hash ⇒ Object
75 76 77 |
# File 'lib/convenient_service/support/cache/entities/key.rb', line 75 def hash [args, kwargs, block&.source_location].hash end |