Module: SupermarketApi::Client::Tools

Included in:
SupermarketApi::Client
Defined in:
lib/supermarketapi/client/tools.rb

Overview

Methods for the tools API.

Instance Method Summary collapse

Instance Method Details

#tool(tool_name) ⇒ Hashie::Mash

Show all information about a tool

This method returns all available information for the given tool

Examples:

client.tool('berkshelf')

Returns:

  • (Hashie::Mash)

    The properties of the cookbook.



17
18
19
# File 'lib/supermarketapi/client/tools.rb', line 17

def tool(tool_name)
  get "/tools/#{tool_name}"
end

#tools(query, start = 0, items = 50) ⇒ Hashie::Mash

Tools search endpoint

This method returns high level information for a number of tools based on search

Examples:

client.tools-search(query='berk', start=0, items=100)

Returns:

  • (Hashie::Mash)

    The properties of the cookbook.



29
30
31
32
33
34
35
36
# File 'lib/supermarketapi/client/tools.rb', line 29

def tools(query, start=0, items=50)
  options = {
    :start => start,
    :items => items,
    :q => query,
  }
  get "/tools-search", options
end