Class: MrMurano::SC_Device

Inherits:
ServiceConfig show all
Defined in:
lib/MrMurano/Solution-ServiceConfig.rb

Instance Method Summary collapse

Methods inherited from ServiceConfig

#fetch, #list, #scid, #scid_for_name

Methods inherited from SolutionBase

#docmp, #dodiff, #download, #endPoint, #localitems, #locallist, #removelocal, #status, #syncdown, #synckey, #syncup, #toRemoteItem, #tolocalname, #tolocalpath

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

#initializeSC_Device

Returns a new instance of SC_Device.



31
32
33
34
# File 'lib/MrMurano/Solution-ServiceConfig.rb', line 31

def initialize
  super
  @serviceName = 'device'
end

Instance Method Details

#assignTriggers(products) ⇒ Object



36
37
38
39
40
41
42
# File 'lib/MrMurano/Solution-ServiceConfig.rb', line 36

def assignTriggers(products)
  details = fetch(scid)
  products = [products] unless products.kind_of? Array
  details[:triggers] = {:pid=>products, :vendor=>products}

  put('/'+scid, details)
end

#showTriggersObject



44
45
46
47
48
49
# File 'lib/MrMurano/Solution-ServiceConfig.rb', line 44

def showTriggers
  details = fetch(scid)

  return [] if details[:triggers].nil?
  details[:triggers][:pid]
end