Class: ConvenientService::Utils::Hash::Except
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::Hash::Except
- Defined in:
- lib/convenient_service/utils/hash/except.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#keys ⇒ Object
readonly
Returns the value of attribute keys.
Instance Method Summary collapse
- #call ⇒ Hash
- #initialize(hash, keys) ⇒ void constructor
Methods inherited from Support::Command
Constructor Details
#initialize(hash, keys) ⇒ void
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
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
20 21 22 |
# File 'lib/convenient_service/utils/hash/except.rb', line 20 def hash @hash end |
#keys ⇒ Object (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
#call ⇒ Hash
45 46 47 |
# File 'lib/convenient_service/utils/hash/except.rb', line 45 def call hash.slice(*hash.keys - keys) end |