class ConstantContact::Util::Config
Attributes
props[RW]
Public Class Methods
configure() { |props| ... }
click to toggle source
# File lib/constantcontact/util/config.rb, line 151 def configure yield props if block_given? end
get(index)
click to toggle source
Get a configuration property given a specified location, example usage: Config::get
(‘auth.token_endpoint’) @param [String] index - location of the property to obtain @return [String]
# File lib/constantcontact/util/config.rb, line 158 def get(index) properties = index.split('.') get_value(properties, props) end
Private Class Methods
get_value(index, value)
click to toggle source
Navigate through a config array looking for a particular index @param [Array] index The index sequence we are navigating down @param [Hash, String] value The portion of the config array to process @return [String]
# File lib/constantcontact/util/config.rb, line 169 def get_value(index, value) index = index.is_a?(Array) ? index : [index] key = index.shift.to_sym value.is_a?(Hash) and value[key] and value[key].is_a?(Hash) ? get_value(index, value[key]) : value[key] end