Class: Octopart::Base

Inherits:
Hashie::Mash
  • Object
show all
Defined in:
lib/octopart/base.rb

Direct Known Subclasses

Part

Constant Summary collapse

API_BASE =
'http://octopart.com/api/v2/'

Class Method Summary collapse

Class Method Details

.get(path, params = nil) ⇒ Object



7
8
9
10
# File 'lib/octopart/base.rb', line 7

def get(path, params = nil)
  params.merge!(apikey: Octopart.configuration.apikey) if Octopart.configuration.apikey
  RestClient.get("#{API_BASE}#{path}", params: params)
end