Class: CollectionSpace::Search

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

Overview

CollectionSpace search

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Search.



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

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

Instance Attribute Details

#expressionObject

Returns the value of attribute expression.



4
5
6
# File 'lib/collectionspace/client/search.rb', line 4

def expression
  @expression
end

#fieldObject

Returns the value of attribute field.



4
5
6
# File 'lib/collectionspace/client/search.rb', line 4

def field
  @field
end

#pathObject

Returns the value of attribute path.



4
5
6
# File 'lib/collectionspace/client/search.rb', line 4

def path
  @path
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/collectionspace/client/search.rb', line 4

def type
  @type
end

Instance Method Details

#from_hash(query) ⇒ Object



13
14
15
16
17
18
# File 'lib/collectionspace/client/search.rb', line 13

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