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