Class: ConvenientService::Utils::Hash::Except

Inherits:
Support::Command show all
Defined in:
lib/convenient_service/utils/hash/except.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Support::Command

[], call

Constructor Details

#initialize(hash, keys) ⇒ void

Parameters:



33
34
35
36
# File 'lib/convenient_service/utils/hash/except.rb', line 33

def initialize(hash, keys)
  @hash = hash
  @keys = keys
end

Instance Attribute Details

#hashObject (readonly)

Returns the value of attribute hash.



20
21
22
# File 'lib/convenient_service/utils/hash/except.rb', line 20

def hash
  @hash
end

#keysObject (readonly)

Returns the value of attribute keys.



26
27
28
# File 'lib/convenient_service/utils/hash/except.rb', line 26

def keys
  @keys
end

Instance Method Details

#callHash

Returns:



45
46
47
# File 'lib/convenient_service/utils/hash/except.rb', line 45

def call
  hash.slice(*hash.keys - keys)
end