Class: Caml::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/caml/caml.rb

Overview

def self.wrap(object)

if object.nil?
  []
elsif object.respond_to?(:to_ary)
  object.to_ary || [object]
else
  [object]
end

end

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



15
16
17
18
19
# File 'lib/caml/caml.rb', line 15

def initialize
  # Recursively load (prompt to init if it doesn't exist)
  SafeYAML::OPTIONS[:default_mode] = :safe
  @config = YAML.load_file(File.join(Dir.getwd, 'caml.yaml'))
end

Instance Method Details

#directivesObject



21
22
23
# File 'lib/caml/caml.rb', line 21

def directives
  @config
end

#to_sObject



25
26
27
# File 'lib/caml/caml.rb', line 25

def to_s
  inspect
end