class HerdstWorker::Configuration::Paths

Attributes

paths[RW]
root_path[RW]

Public Class Methods

new() click to toggle source
# File lib/herdst_worker/configuration/paths.rb, line 9
def initialize
    self.root_path = ENV["ROOT_PATH"] || Dir.pwd
    
    self.paths = ActiveSupport::HashWithIndifferentAccess.new
    self.paths[:root] = self.root_path
    self.paths[:app] = "#{self.root_path}/app"
    self.paths[:config] = "#{self.root_path}/config"
    self.paths[:temp] = "#{self.root_path}/tmp"
end

Public Instance Methods

[](name) click to toggle source
# File lib/herdst_worker/configuration/paths.rb, line 25
def [](name)
    self.paths[name]
end
[]=(name, value) click to toggle source
# File lib/herdst_worker/configuration/paths.rb, line 20
def []=(name, value)
    self.paths[name] = "#{self.root_path}/#{value}"
end
method_missing(name) click to toggle source
# File lib/herdst_worker/configuration/paths.rb, line 30
def method_missing(name)
    if self.paths.include?(name)
        self.paths[name]
    else
        raise NoMethodError
    end                
end