Class: WashOut::SoapConfig
- Inherits:
-
Object
- Object
- WashOut::SoapConfig
- Extended by:
- Forwardable
- Defined in:
- lib/wash_out/soap_config.rb
Overview
Configuration options for Client, defaulting to values in Default
Constant Summary collapse
- DEFAULT_CONFIG =
{ parser: :rexml, namespace: 'urn:WashOut', wsdl_style: 'rpc', snakecase_input: false, camelize_wsdl: false, catch_xml_errors: false, wsse_username: nil, wsse_password: nil, wsse_auth_callback: nil, soap_action_routing: true, }
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Class Method Summary collapse
- .config ⇒ Object
-
.keys ⇒ Object
The keys allowed.
- .soap_accessor(*syms) ⇒ Object
Instance Method Summary collapse
- #configure(options = {}) ⇒ Object
- #default? ⇒ Boolean
-
#initialize(options = {}) ⇒ SoapConfig
constructor
A new instance of SoapConfig.
Constructor Details
#initialize(options = {}) ⇒ SoapConfig
Returns a new instance of SoapConfig.
57 58 59 60 61 62 |
# File 'lib/wash_out/soap_config.rb', line 57 def initialize( = {}) @config = {} .reverse_merge!(engine_config) if engine_config .reverse_merge!(DEFAULT_CONFIG) configure end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
20 21 22 |
# File 'lib/wash_out/soap_config.rb', line 20 def config @config end |
Class Method Details
.config ⇒ Object
29 30 31 |
# File 'lib/wash_out/soap_config.rb', line 29 def self.config DEFAULT_CONFIG end |
.keys ⇒ Object
The keys allowed
25 26 27 |
# File 'lib/wash_out/soap_config.rb', line 25 def self.keys @keys ||= config.keys end |
.soap_accessor(*syms) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/wash_out/soap_config.rb', line 33 def self.soap_accessor(*syms) syms.each do |sym| unless sym =~ /^[_A-Za-z]\w*$/ raise NameError.new("invalid class attribute name: #{sym}") end class_eval(<<-EOS, __FILE__, __LINE__ + 1) unless defined? @#{sym} @#{sym} = nil end def #{sym} @#{sym} end def #{sym}=(obj) @#{sym} = obj end EOS end end |
Instance Method Details
#configure(options = {}) ⇒ Object
68 69 70 71 72 73 74 |
# File 'lib/wash_out/soap_config.rb', line 68 def configure( = {}) @config.merge! validate_config!() config.each do |key,value| send("#{key}=", value) end end |
#default? ⇒ Boolean
64 65 66 |
# File 'lib/wash_out/soap_config.rb', line 64 def default? DEFAULT_CONFIG.sort == config.sort end |