Class: Qingting::Config

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.propsObject

Returns the value of attribute props.



19
20
21
# File 'lib/qingting/config.rb', line 19

def props
  @props
end

Class Method Details

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

Yields:



21
22
23
# File 'lib/qingting/config.rb', line 21

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)


28
29
30
31
# File 'lib/qingting/config.rb', line 28

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