Class: AmazonStaticSite::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#fileObject (readonly)

Returns the value of attribute file.



3
4
5
# File 'lib/amazon_static_site/config.rb', line 3

def file
  @file
end

#folderObject (readonly)

Returns the value of attribute folder.



3
4
5
# File 'lib/amazon_static_site/config.rb', line 3

def folder
  @folder
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/amazon_static_site/config.rb', line 3

def options
  @options
end

#workerObject (readonly)

Returns the value of attribute worker.



3
4
5
# File 'lib/amazon_static_site/config.rb', line 3

def worker
  @worker
end