Class: Argo::ConstraintProcessor

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/argo/constraint_processor.rb

Constant Summary collapse

NON_CONSTRAINT_PROPERTIES =
%w[
  description
  items
  type
]

Instance Method Summary collapse

Constructor Details

#initialize(dereferencer) ⇒ ConstraintProcessor

Returns a new instance of ConstraintProcessor.



13
14
15
# File 'lib/argo/constraint_processor.rb', line 13

def initialize(dereferencer)
  @dereferencer = dereferencer
end

Instance Method Details

#process(hash) ⇒ Object



17
18
19
20
21
# File 'lib/argo/constraint_processor.rb', line 17

def process(hash)
  process_hash(
    hash.reject { |k, _| NON_CONSTRAINT_PROPERTIES.include?(k) }
  )
end