Class: Franklin::Config
- Inherits:
-
Object
- Object
- Franklin::Config
- Defined in:
- lib/franklin/config.rb
Constant Summary collapse
- DEFAULT_CONFIG_FILE =
File.join(Dir.home, ".franklin").freeze
Instance Attribute Summary collapse
-
#default_type ⇒ Object
readonly
Returns the value of attribute default_type.
-
#libraries ⇒ Object
readonly
Returns the value of attribute libraries.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Config
constructor
A new instance of Config.
Constructor Details
Instance Attribute Details
#default_type ⇒ Object (readonly)
Returns the value of attribute default_type.
7 8 9 |
# File 'lib/franklin/config.rb', line 7 def default_type @default_type end |
#libraries ⇒ Object (readonly)
Returns the value of attribute libraries.
7 8 9 |
# File 'lib/franklin/config.rb', line 7 def libraries @libraries end |
Class Method Details
.from_yaml(yaml) ⇒ Object
17 18 19 |
# File 'lib/franklin/config.rb', line 17 def from_yaml(yaml) new(YAML.load(yaml)) end |
.load_from_file(file_path = nil) ⇒ Object
21 22 23 |
# File 'lib/franklin/config.rb', line 21 def load_from_file(file_path = nil) from_yaml(File.read(file_path || DEFAULT_CONFIG_FILE)) end |