Class: Configurator
- Inherits:
-
Object
- Object
- Configurator
- Defined in:
- lib/halchemy/configurator.rb
Overview
provides default configuration values, which can be overridden by a config file in the home directory or the project directory
Constant Summary collapse
- DEFAULT_CONFIG =
{ "halchemy" => { "base_url" => "http://localhost:2112", "parameters_list_style" => "repeat_key", "etag_field" => "_etag" }, "headers" => { "Content-type" => "application/json", "Accept" => "application/hal+json, application/json;q=0.9, */*;q=0.8", "Authorization" => "Basic cm9vdDpwYXNzd29yZA==" # root:password }, "error_handling" => { "raise_for_network_errors" => true, "raise_for_status_codes" => nil } }.freeze
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(filename = ".halchemy") ⇒ Configurator
constructor
A new instance of Configurator.
Constructor Details
#initialize(filename = ".halchemy") ⇒ Configurator
Returns a new instance of Configurator.
28 29 30 31 32 |
# File 'lib/halchemy/configurator.rb', line 28 def initialize(filename = ".halchemy") @filename = filename @config = DEFAULT_CONFIG.dup load_config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
26 27 28 |
# File 'lib/halchemy/configurator.rb', line 26 def config @config end |