Class: ElasticAdapter::Decoration::CountResponse

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

Overview

Used to wrap responses from the elasticsearch count api After decoration the decorator will point to the actual count returned by elasticsearch

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(object) ⇒ Integer

Reduced the hash to the count returned by elasticsearch

Parameters:

  • object (Object)

Returns:

  • (Integer)

    the count returned by elasticsearch


11
12
13
# File 'lib/elastic_adapter/decoration/count_response.rb', line 11

def alter_object(object)
  object[:count]
end