Class: Aerial::Config

Inherits:
Object show all
Defined in:
lib/aerial/config.rb

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(yaml) ⇒ Config

Returns a new instance of Config.



9
10
11
# File 'lib/aerial/config.rb', line 9

def initialize(yaml)
  @config = nested_hash_to_openstruct(yaml)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *attributes) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/aerial/config.rb', line 19

def method_missing(method_name, *attributes)
  if @config.respond_to?(method_name.to_sym)
    return @config.send(method_name.to_sym)
  else
    false
  end
end

Class Attribute Details

.configObject

Returns the value of attribute config.



6
7
8
# File 'lib/aerial/config.rb', line 6

def config
  @config
end

Instance Method Details

#theme_directoryObject

Complete path to the directory theme



14
15
16
17
# File 'lib/aerial/config.rb', line 14

def theme_directory
  directory = File.join(AERIAL_ROOT, self.views.dir)
  File.join(directory)
end