Class: Config
- Inherits:
-
Object
- Object
- Config
- Defined in:
- lib/meshx-plugin-sdk.rb
Instance Method Summary collapse
- #get(name) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #load ⇒ Object
Constructor Details
Instance Method Details
#get(name) ⇒ Object
324 325 326 327 328 329 330 331 |
# File 'lib/meshx-plugin-sdk.rb', line 324 def get(name) rtn = @config[name] if rtn == "" puts("plugin configuration is not valid, missing: #{name}") exit(2) end return rtn end |
#load ⇒ Object
318 319 320 321 322 |
# File 'lib/meshx-plugin-sdk.rb', line 318 def load() file = File.read(@config_path) config = JSON.parse(file) return config end |