Class: Visage::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/visage-app/config.rb,
lib/visage-app/config/file.rb

Defined Under Namespace

Classes: File

Class Method Summary collapse

Class Method Details

.method_missing(method, *args) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/visage-app/config.rb', line 10

def method_missing(method, *args)
  if method.to_s[-1,1] == '='
    @configuration[method.to_s.tr('=','')] = *args
  else
    @configuration[method.to_s]
  end
end

.to_hashObject



18
19
20
# File 'lib/visage-app/config.rb', line 18

def to_hash
  @configuration
end

.use {|@configuration| ... } ⇒ Object

Yields:

  • (@configuration)


4
5
6
7
8
# File 'lib/visage-app/config.rb', line 4

def use
  @configuration ||= {}
  yield @configuration
  nil
end