Class: MrMurano::ProductBase
- Inherits:
-
Object
- Object
- MrMurano::ProductBase
- Defined in:
- lib/MrMurano/Product.rb
Direct Known Subclasses
Product, Product1PDevice, ProductContent, ProductModel, ProductResources, ProductSerialNumber
Instance Method Summary collapse
-
#endPoint(path = '') ⇒ Object
Generate an endpoint in Murano Uses the uriparts and path.
-
#initialize ⇒ ProductBase
constructor
A new instance of ProductBase.
Methods included from Verbose
#debug, #error, #outf, #tabularize, #verbose, #warning
Methods included from Http
#curldebug, #delete, #get, #http, #http_reset, #isJSON, #json_opts, #post, #postf, #put, #set_def_headers, #showHttpError, #token, #workit
Constructor Details
#initialize ⇒ ProductBase
Returns a new instance of ProductBase.
10 11 12 13 14 15 16 |
# File 'lib/MrMurano/Product.rb', line 10 def initialize @pid = $cfg['product.id'] raise "No Product ID!" if @pid.nil? @uriparts = [:product, @pid] @locationbase = $cfg['location.base'] @location = nil end |
Instance Method Details
#endPoint(path = '') ⇒ Object
Generate an endpoint in Murano Uses the uriparts and path
25 26 27 28 29 |
# File 'lib/MrMurano/Product.rb', line 25 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 |