Class: ElasticsearchHermes::Result::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/elasticsearch_hermes/result/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(took:, timed_out:, hits:, _shards:) ⇒ Base

Returns a new instance of Base.



8
9
10
11
12
13
# File 'lib/elasticsearch_hermes/result/base.rb', line 8

def initialize(took:, timed_out:, hits:, _shards:)
  @took = took
  @timed_out = timed_out
  @shards = _shards
  @hits = hits
end

Instance Attribute Details

#hitsObject (readonly)

Returns the value of attribute hits.



6
7
8
# File 'lib/elasticsearch_hermes/result/base.rb', line 6

def hits
  @hits
end

#shardsObject (readonly)

Returns the value of attribute shards.



6
7
8
# File 'lib/elasticsearch_hermes/result/base.rb', line 6

def shards
  @shards
end

#timed_outObject (readonly)

Returns the value of attribute timed_out.



6
7
8
# File 'lib/elasticsearch_hermes/result/base.rb', line 6

def timed_out
  @timed_out
end

#tookObject (readonly)

Returns the value of attribute took.



6
7
8
# File 'lib/elasticsearch_hermes/result/base.rb', line 6

def took
  @took
end

Instance Method Details

#idsObject



15
16
17
# File 'lib/elasticsearch_hermes/result/base.rb', line 15

def ids
  @ids ||= @hits['hits'].map { |hit| hit['_id'] }
end

#modelsObject



19
20
21
# File 'lib/elasticsearch_hermes/result/base.rb', line 19

def models
  @models ||= ''
end