Class: AmazonStaticSite::Config
- Inherits:
-
Object
- Object
- AmazonStaticSite::Config
- Defined in:
- lib/amazon_static_site/config.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#folder ⇒ Object
readonly
Returns the value of attribute folder.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#worker ⇒ Object
readonly
Returns the value of attribute worker.
Instance Method Summary collapse
-
#initialize(file: "./config.yml", folder: "./public") ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(file: "./config.yml", folder: "./public") ⇒ Config
Returns a new instance of Config.
7 8 9 10 11 12 |
# File 'lib/amazon_static_site/config.rb', line 7 def initialize(file: "./config.yml", folder: "./public") @file = file @folder = folder.gsub(/\/$/, '') @worker = worker @options = JSON.parse(YAML.load_file(file).to_json, object_class: OpenStruct) end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
3 4 5 |
# File 'lib/amazon_static_site/config.rb', line 3 def file @file end |
#folder ⇒ Object (readonly)
Returns the value of attribute folder.
3 4 5 |
# File 'lib/amazon_static_site/config.rb', line 3 def folder @folder end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/amazon_static_site/config.rb', line 3 def @options end |
#worker ⇒ Object (readonly)
Returns the value of attribute worker.
3 4 5 |
# File 'lib/amazon_static_site/config.rb', line 3 def worker @worker end |