class TripSpark::Configuration
Constants
- DEFAULT_CONFIGURATION
The defaults to use for any configuration options that are not provided
- REQUIRED_CONFIGURATION
The options required when configuring a
TripSpark
instance
Attributes
adapter[RW]
The adapter to use for network communication
base_uri[RW]
The base URL of the TripSpark
system
debug_output[RW]
The output stream to which debug information should be written
version[RW]
The version of the TripSpark
system
Public Class Methods
new()
click to toggle source
# File lib/tripspark_api/configuration.rb, line 24 def initialize # Apply the default set of configurations before anything else to ensure # all options are initialized. DEFAULT_CONFIGURATION.each do |name, value| send("#{name}=", value) end end
Public Instance Methods
validate!()
click to toggle source
Ensure that all required configurations have been given a value. Returns true if all required configuration options have been set.
# File lib/tripspark_api/configuration.rb, line 34 def validate! REQUIRED_CONFIGURATION.each do |name| raise "`#{name}` is a required configuration option, but was not given a value." if send("#{name}").nil? end true end