Class: ShipHero::Util::Config

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.propsObject

Returns the value of attribute props.



51
52
53
# File 'lib/ship_hero/util/config.rb', line 51

def props
  @props
end

Class Method Details

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

Yields:



53
54
55
# File 'lib/ship_hero/util/config.rb', line 53

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)


60
61
62
63
# File 'lib/ship_hero/util/config.rb', line 60

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