Class: Iterable::Util::Config

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.propsObject

Returns the value of attribute props.



52
53
54
# File 'lib/iterable/util/config.rb', line 52

def props
  @props
end

Class Method Details

.configure {|props| ... } ⇒ Object

Yields:



54
55
56
# File 'lib/iterable/util/config.rb', line 54

def configure
  yield props if block_given?
end

.get(index) ⇒ String

Get a configuration property given a specified location, example usage: Config::get(‘auth.token_endpoint’)

Parameters:

  • index (String)
    • location of the property to obtain

Returns:

  • (String)


61
62
63
64
# File 'lib/iterable/util/config.rb', line 61

def get(index)
  properties = index.split('.')
  get_value(properties, props)
end