Module: YieldStarClient::Configuration
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ YieldStarClient
Configures this module through the given
block
. -
#debug? ⇒ Boolean
True if debug logging of SOAP requests and responses has been enabled; false otherwise.
-
#reset ⇒ Object
Resets this module’s configuration.
Instance Attribute Details
#logger ⇒ Object
46 47 48 |
# File 'lib/yield_star_client/configuration.rb', line 46 def logger @logger ||= Logger.new(STDOUT) end |
Class Method Details
.extended(base) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/yield_star_client/configuration.rb', line 17 def self.extended(base) # Default configuration - happens whether or not .configure is called base.config :yield_star do default :endpoint => DEFAULT_ENDPOINT default :namespace => DEFAULT_NAMESPACE default :debug => false end end |
Instance Method Details
#configure {|_self| ... } ⇒ YieldStarClient
Configures this module through the given block
. Default configuration options will be applied unless they are explicitly overridden in the block
.
74 75 76 77 78 79 80 |
# File 'lib/yield_star_client/configuration.rb', line 74 def configure config :yield_star do yield self end self end |
#debug? ⇒ Boolean
True if debug logging of SOAP requests and responses has been enabled; false otherwise.
39 40 41 |
# File 'lib/yield_star_client/configuration.rb', line 39 def debug? self[:debug] == 'true' end |
#reset ⇒ Object
Resets this module’s configuration. Configuration options will be set to default values if they exist; otherwise, they will be set to nil.
89 90 91 92 |
# File 'lib/yield_star_client/configuration.rb', line 89 def reset VALID_CONFIG_OPTIONS.each { |opt| self.send("#{opt}=", nil) } self.logger = nil end |