Class: Litter::Config

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

Overview

Builds a hash config.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(custom_config = {}) ⇒ Config

Returns a new instance of Config.

Parameters:

  • custom_config (Hash) (defaults to: {})

    a custom config which overrides the defaults, e.g. { parser: { date_sep: ‘-’ } }



10
11
12
# File 'lib/litter/config.rb', line 10

def initialize(custom_config = {})
  @hash = default_config.deep_merge(custom_config)
end

Instance Attribute Details

#hashObject (readonly)

Returns the value of attribute hash.



6
7
8
# File 'lib/litter/config.rb', line 6

def hash
  @hash
end