Class: Aerial::Config
Class Attribute Summary collapse
-
.config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(yaml) ⇒ Config
constructor
A new instance of Config.
- #method_missing(method_name, *attributes) ⇒ Object
-
#theme_directory ⇒ Object
Complete path to the directory theme.
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
.config ⇒ Object
Returns the value of attribute config.
6 7 8 |
# File 'lib/aerial/config.rb', line 6 def config @config end |
Instance Method Details
#theme_directory ⇒ Object
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 |