Class: Fenix::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/fenix/core/settings.rb

Instance Method Summary collapse

Constructor Details

#initialize(file = nil) ⇒ Settings

Returns a new instance of Settings.

Since:

  • 1.0.0



5
6
7
# File 'lib/fenix/core/settings.rb', line 5

def initialize(file = nil)
  @settings = {}
end

Instance Method Details

#[](key) ⇒ Object

Returns the provided configuration option

Examples:

settings[:compress_assets]
# => true

settings.compress_assets
# => true

Parameters:

  • key (Symbol)

Since:

  • 1.0.0



24
25
26
# File 'lib/fenix/core/settings.rb', line 24

def [](key)
  @settings[key.to_sym]
end

#[]=(key, value) ⇒ value

Sets the provided configuration option

Examples:

settings[:compress_assets] = true
settings.compress_assets = true

Parameters:

  • key (Symbol)
  • value

Returns:

  • (value)

Since:

  • 1.0.0



42
43
44
# File 'lib/fenix/core/settings.rb', line 42

def []=(key, value)
  @settings[key.to_sym] = value
end