Class: HashFilter::Operation

Inherits:
Object
  • Object
show all
Defined in:
lib/hash_filter.rb

Direct Known Subclasses

Delete, Rename

Defined Under Namespace

Classes: Delete, Rename

Instance Method Summary collapse

Constructor Details

#initialize(key) ⇒ Operation

Returns a new instance of Operation.



53
54
55
# File 'lib/hash_filter.rb', line 53

def initialize(key)
  @key = key
end

Instance Method Details

#execute(hash, key) ⇒ Object

Raises:

  • (NotImplementedError)


57
58
59
# File 'lib/hash_filter.rb', line 57

def execute(hash, key)
  raise NotImplementedError
end

#matches?(key) ⇒ Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/hash_filter.rb', line 61

def matches?(key)
  @key === key
end