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:



28
29
30
31
# File 'lib/convenient_service/utils/hash/except.rb', line 28

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

Instance Attribute Details

#hashObject (readonly)

Returns the value of attribute hash.



15
16
17
# File 'lib/convenient_service/utils/hash/except.rb', line 15

def hash
  @hash
end

#keysObject (readonly)

Returns the value of attribute keys.



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

def keys
  @keys
end

Instance Method Details

#callHash

Returns:



40
41
42
# File 'lib/convenient_service/utils/hash/except.rb', line 40

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