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
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
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
15 16 17 |
# File 'lib/convenient_service/utils/hash/except.rb', line 15 def hash @hash end |
#keys ⇒ Object (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
#call ⇒ Hash
40 41 42 |
# File 'lib/convenient_service/utils/hash/except.rb', line 40 def call hash.slice(*hash.keys - keys) end |