Class: Walnut::Configuration

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/walnut/configuration.rb

Overview

Dummy class to give a namespace to the configuration object.

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object

Convenience for accessing keys

Parameters:

  • key (#to_s)

    The key you are accessing

Returns:

  • (Object)

    The value of the key.



18
19
20
# File 'lib/walnut/configuration.rb', line 18

def [](key)
  send(key.to_s)
end

#[]=(key, value) ⇒ Object

Convenience method to set keys

Parameters:

  • key (#to_s)

    The key you will be assigning the value to.

  • value (Object)

    The new value to assign to the key.

Returns:

  • (Object)

    The value you passed to assign to the key.



29
30
31
# File 'lib/walnut/configuration.rb', line 29

def []=(key, value)
  send(key.to_s << "=", value)
end