Class: MrMurano::ProductBase

Inherits:
Object
  • Object
show all
Includes:
Http, Verbose
Defined in:
lib/MrMurano/Product.rb

Instance Method Summary collapse

Methods included from Verbose

#debug, #verbose

Methods included from Http

#curldebug, #delete, #get, #http, #http_reset, #json_opts, #post, #postf, #put, #set_def_headers, #showHttpError, #token, #tryToPrettyJSON, #workit

Constructor Details

#initializeProductBase

Returns a new instance of ProductBase.



10
11
12
13
14
# File 'lib/MrMurano/Product.rb', line 10

def initialize
  @pid = $cfg['product.id']
  raise "No Product ID!" if @pid.nil?
  @uriparts = [:product, @pid]
end

Instance Method Details

#endPoint(path = '') ⇒ Object



19
20
21
22
23
# File 'lib/MrMurano/Product.rb', line 19

def endPoint(path='')
  parts = ['https:/', $cfg['net.host'], 'api:1'] + @uriparts
  s = parts.map{|v| v.to_s}.join('/')
  URI(s + path.to_s)
end