Sha256: 7676d99fe7626fdb653eaca2dcd64275fcd5c2d7e93008adfa4201b41940f4ed

Contents?: true

Size: 399 Bytes

Versions: 6

Compression:

Stored size: 399 Bytes

Contents

module CollectionSpace

  class Search
    attr_accessor :path, :type, :field, :expression

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

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

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
collectionspace-client-0.1.5 lib/collectionspace/client/search.rb
collectionspace-client-0.1.4 lib/collectionspace/client/search.rb
collectionspace-client-0.1.3 lib/collectionspace/client/search.rb
collectionspace-client-0.1.2 lib/collectionspace/client/search.rb
collectionspace-client-0.1.1 lib/collectionspace/client/search.rb
collectionspace-client-0.1.0 lib/collectionspace/client/search.rb