class TYCiCore::Config

Public Class Methods

new(path) click to toggle source
# File lib/tuya/ci/core/config.rb, line 3
def initialize(path)
        raise "Can not find config at : #{path}" unless File.exist? path
        @content = File.read path
        @content_json = JSON @content
end

Public Instance Methods

method_missing(name) click to toggle source
Calls superclass method
# File lib/tuya/ci/core/config.rb, line 13
def method_missing(name)
        if @content_json.has_key? name.to_s
                @content_json[name.to_s]
        else
                super.method_missing name
        end
end
value(key) click to toggle source
# File lib/tuya/ci/core/config.rb, line 9
def value(key)
        eval("@content_json" << key.split('.').map { |i| "[\"" + i + "\"]" }.join)
end