Class: CollectionSpace::Search

Inherits:
Object
  • Object
show all
Defined in:
lib/collectionspace/client/search.rb

Overview

CollectionSpace search

Constant Summary collapse

DEFAULT_SORT =
"collectionspace_core:updatedAt DESC"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path: nil, namespace: nil, field: nil, expression: nil) ⇒ Search

Returns a new instance of Search.



10
11
12
13
14
15
# File 'lib/collectionspace/client/search.rb', line 10

def initialize(path: nil, namespace: nil, field: nil, expression: nil)
  @path = path
  @namespace = namespace
  @field = field
  @expression = expression
end

Instance Attribute Details

#expressionObject

Returns the value of attribute expression.



6
7
8
# File 'lib/collectionspace/client/search.rb', line 6

def expression
  @expression
end

#fieldObject

Returns the value of attribute field.



6
7
8
# File 'lib/collectionspace/client/search.rb', line 6

def field
  @field
end

#namespaceObject

Returns the value of attribute namespace.



6
7
8
# File 'lib/collectionspace/client/search.rb', line 6

def namespace
  @namespace
end

#pathObject

Returns the value of attribute path.



6
7
8
# File 'lib/collectionspace/client/search.rb', line 6

def path
  @path
end

Instance Method Details

#from_hash(query) ⇒ Object



17
18
19
20
21
22
# File 'lib/collectionspace/client/search.rb', line 17

def from_hash(query)
  query.each do |property, value|
    instance_variable_set(:"@#{property}", value)
  end
  self
end