Class: Solr::Query::Response::Spellcheck

Inherits:
Object
  • Object
show all
Defined in:
lib/solr/query/response/spellcheck.rb

Defined Under Namespace

Classes: Collation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Spellcheck

Returns a new instance of Spellcheck.



30
31
32
# File 'lib/solr/query/response/spellcheck.rb', line 30

def initialize(response)
  @response = response || {}
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/solr/query/response/spellcheck.rb', line 5

def response
  @response
end

Class Method Details

.emptyObject



26
27
28
# File 'lib/solr/query/response/spellcheck.rb', line 26

def self.empty
  new({})
end

Instance Method Details

#collationsObject



34
35
36
37
38
# File 'lib/solr/query/response/spellcheck.rb', line 34

def collations
  Array(response['collations']).flatten(1).in_groups_of(2).map do |_, collation|
    Collation.new(collation)
  end
end