Class: Drillbit::Parameters::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/drillbit/parameters/index.rb

Constant Summary collapse

DEFAULT_QUERY =
'*'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_parameters) ⇒ Index

Returns a new instance of Index.



10
11
12
# File 'lib/drillbit/parameters/index.rb', line 10

def initialize(raw_parameters)
  self.raw_parameters = raw_parameters || {}
end

Instance Attribute Details

#raw_parametersObject

Returns the value of attribute raw_parameters.



8
9
10
# File 'lib/drillbit/parameters/index.rb', line 8

def raw_parameters
  @raw_parameters
end

Instance Method Details

#present?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/drillbit/parameters/index.rb', line 14

def present?
  query
end

#queryObject



18
19
20
# File 'lib/drillbit/parameters/index.rb', line 18

def query
  compacted_parameters['query'] || compacted_parameters['q']
end