Class: ElasticAdapter::Decoration::ValidationResponse

Inherits:
Decorator
  • Object
show all
Defined in:
lib/elastic_adapter/decoration/validation_response.rb

Overview

Used to decorate responses from the elasticseach suggest api. Delegates to a Boolean

Instance Attribute Summary

Attributes inherited from Decorator

#original_object

Instance Method Summary collapse

Methods inherited from Decorator

#initialize, #object

Constructor Details

This class inherits a constructor from ElasticAdapter::Decoration::Decorator

Instance Method Details

#alter_object(hash) ⇒ Hash

Returns the validation status from the original hash

Parameters:

  • hash (Hash)

Returns:

  • (Hash)

10
11
12
# File 'lib/elastic_adapter/decoration/validation_response.rb', line 10

def alter_object(hash)
  hash[:valid]
end