Class: MrMurano::ServiceConfig

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

Overview

…/serviceconfig

Direct Known Subclasses

Keystore, SC_Device, Timeseries

Instance Method Summary collapse

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

#initializeServiceConfig

Returns a new instance of ServiceConfig.



6
7
8
9
# File 'lib/MrMurano/Solution-ServiceConfig.rb', line 6

def initialize
  super
  @uriparts << 'serviceconfig'
end

Instance Method Details

#fetch(id) ⇒ Object



14
15
16
# File 'lib/MrMurano/Solution-ServiceConfig.rb', line 14

def fetch(id)
  get('/' + id.to_s)
end

#listObject



11
12
13
# File 'lib/MrMurano/Solution-ServiceConfig.rb', line 11

def list
  get()[:items]
end

#scidObject



24
25
26
27
# File 'lib/MrMurano/Solution-ServiceConfig.rb', line 24

def scid
  return @scid unless @scid.nil?
  @scid = scid_for_name(@serviceName)
end

#scid_for_name(name) ⇒ Object



18
19
20
21
22
# File 'lib/MrMurano/Solution-ServiceConfig.rb', line 18

def scid_for_name(name)
  name = name.to_s unless name.kind_of? String
  scr = list().select{|i| i[:service] == name}.first
  scid = scr[:id]
end