Class: CollectionSpace::Search
- Inherits:
-
Object
- Object
- CollectionSpace::Search
- Defined in:
- lib/collectionspace/client/search.rb
Overview
CollectionSpace search
Constant Summary collapse
- DEFAULT_SORT =
"collectionspace_core:updatedAt DESC"
Instance Attribute Summary collapse
-
#expression ⇒ Object
Returns the value of attribute expression.
-
#field ⇒ Object
Returns the value of attribute field.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #from_hash(query) ⇒ Object
-
#initialize(path: nil, namespace: nil, field: nil, expression: nil) ⇒ Search
constructor
A new instance of Search.
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
#expression ⇒ Object
Returns the value of attribute expression.
6 7 8 |
# File 'lib/collectionspace/client/search.rb', line 6 def expression @expression end |
#field ⇒ Object
Returns the value of attribute field.
6 7 8 |
# File 'lib/collectionspace/client/search.rb', line 6 def field @field end |
#namespace ⇒ Object
Returns the value of attribute namespace.
6 7 8 |
# File 'lib/collectionspace/client/search.rb', line 6 def namespace @namespace end |
#path ⇒ Object
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 |