Class: Solr::Query::Request::ShardsPreference

Inherits:
Object
  • Object
show all
Defined in:
lib/solr/query/request/shards_preference.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(properties: []) ⇒ ShardsPreference

Returns a new instance of ShardsPreference.



13
14
15
# File 'lib/solr/query/request/shards_preference.rb', line 13

def initialize(properties: [])
  @properties = properties
end

Instance Attribute Details

#propertiesObject

Returns the value of attribute properties.



7
8
9
# File 'lib/solr/query/request/shards_preference.rb', line 7

def properties
  @properties
end

Class Method Details

.noneObject



9
10
11
# File 'lib/solr/query/request/shards_preference.rb', line 9

def self.none
  new
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/solr/query/request/shards_preference.rb', line 17

def empty?
  properties.empty?
end

#to_solr_sObject



21
22
23
# File 'lib/solr/query/request/shards_preference.rb', line 21

def to_solr_s
  properties.map(&:to_solr_s).join(',')
end