Sha256: 50678fa32370eb0e5a04bd959d5f0b618c0b25436976d2344f5ba3deee258f6f

Contents?: true

Size: 781 Bytes

Versions: 22

Compression:

Stored size: 781 Bytes

Contents

module VagrantCloud
  class Search
    attr_accessor :account

    def initialize(access_token = nil, custom_server = nil)
      @client = Client.new(access_token, custom_server)
    end

    # Requests a search based on the given parameters
    #
    # @param [String] query
    # @param [String] provider
    # @param [String] sort
    # @param [String] order
    # @param [String] limit
    # @param [String] page
    # @return [Hash]
    def search(query = nil, provider = nil, sort = nil, order = nil, limit = nil, page = nil)
      params = {
        q: query,
        provider: provider,
        sort: sort,
        order: order,
        limit: limit,
        page: page
      }.delete_if { |_, v| v.nil? }

      @client.request('get', '/search', params)
    end
  end
end

Version data entries

22 entries across 16 versions & 2 rubygems

Version Path
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.7.0/gems/vagrant_cloud-2.0.3/lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.7.0/gems/vagrant_cloud-2.0.3/lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.7.0/gems/vagrant_cloud-2.0.3/lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/vagrant_cloud-2.0.2/lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/vagrant_cloud-2.0.3/lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/vagrant_cloud-2.0.3/lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/vagrant_cloud-2.0.3/lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.6.0 vendor/bundle/ruby/2.6.0/gems/vagrant_cloud-2.0.3/lib/vagrant_cloud/search.rb
vagrant_cloud-2.0.3 lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.6.0/gems/vagrant_cloud-2.0.2/lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.2/lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.6.0/gems/vagrant_cloud-2.0.2/lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.2/lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.2/lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.3.0 vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/search.rb
vagrant_cloud-2.0.2 lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.2.0 vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/search.rb
vagrant-unbundled-2.2.0.0 vendor/bundle/ruby/2.5.0/gems/vagrant_cloud-2.0.1/lib/vagrant_cloud/search.rb