class Simplexframe::Config

Attributes

content[R]
hash_content[R]

Public Class Methods

new(filepath) click to toggle source
# File lib/simplexframe/simple_config.rb, line 9
def initialize filepath
        @f ||= filepath if valid?(filepath)
        File.open(@f) {|handle| @hash_content = YAML.load(handle)}
        @content = OpenStruct.new(@hash_content)
end

Public Instance Methods

valid?(filepath) click to toggle source
# File lib/simplexframe/simple_config.rb, line 15
def valid?(filepath)
        raise ConfigFileMissingError unless File.exists?(filepath)
        true
end