Class: GomaShika::Config
- Inherits:
-
Object
- Object
- GomaShika::Config
- Defined in:
- lib/goma_shika/config.rb
Class Method Summary collapse
Instance Method Summary collapse
- #formats ⇒ Object
-
#initialize(raw) ⇒ Config
constructor
A new instance of Config.
- #locales ⇒ Object
Constructor Details
#initialize(raw) ⇒ Config
Returns a new instance of Config.
3 4 5 |
# File 'lib/goma_shika/config.rb', line 3 def initialize(raw) @raw = raw end |
Class Method Details
.from_yaml(file_path) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/goma_shika/config.rb', line 7 def self.from_yaml(file_path) raise ArgumentError, "File not found: #{file_path}" unless File.exist?(file_path) yaml_content = File.read(file_path) parsed_content = YAML.safe_load(yaml_content, symbolize_names: true, aliases: true, permitted_classes: [Symbol]) new(parsed_content) end |
Instance Method Details
#formats ⇒ Object
20 21 22 |
# File 'lib/goma_shika/config.rb', line 20 def formats raw[:formats] end |
#locales ⇒ Object
16 17 18 |
# File 'lib/goma_shika/config.rb', line 16 def locales raw[:locales] end |