Class: Hashr::Env::Vars

Inherits:
Struct
  • Object
show all
Defined in:
lib/hashr/env.rb

Constant Summary collapse

FALSE =
[false, nil, 'false', 'nil', '']

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#defaultsObject

Returns the value of attribute defaults

Returns:

  • (Object)

    the current value of defaults


3
4
5
# File 'lib/hashr/env.rb', line 3

def defaults
  @defaults
end

#namespace=(value) ⇒ Object

Sets the attribute namespace

Parameters:

  • value (Object)

    the value to set the attribute namespace to.

Returns:

  • (Object)

    the newly set value


3
4
5
# File 'lib/hashr/env.rb', line 3

def namespace=(value)
  @namespace = value
end

Instance Method Details

#to_hObject


6
7
8
# File 'lib/hashr/env.rb', line 6

def to_h
  defaults.deep_merge(read_env(defaults, namespace.dup))
end