Class: Crowdskout::Util::Config

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.propsObject

Returns the value of attribute props.



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

def props
  @props
end

Class Method Details

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

Yields:



56
57
58
# File 'lib/crowdskout/util/config.rb', line 56

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)


63
64
65
66
# File 'lib/crowdskout/util/config.rb', line 63

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