Class: RazorRisk::Razor::Connectivity::ClarITe2::ConfigMaker
- Inherits:
-
Object
- Object
- RazorRisk::Razor::Connectivity::ClarITe2::ConfigMaker
- Includes:
- Pantheios, Xqsr3::Quality::ParameterChecking
- Defined in:
- lib/razor_risk/razor/connectivity/clarite_2/config_maker.rb
Overview
######################################################################## # classes
Class Method Summary collapse
-
.make(io = nil, **options) ⇒ Object
Makes a ClarITe configuration file.
Class Method Details
.make(io = nil, **options) ⇒ Object
Makes a ClarITe configuration file
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/razor_risk/razor/connectivity/clarite_2/config_maker.rb', line 98 def self.make io = nil, ** trace ParamNames[ :io, :options ], io, check_parameter io, 'io', responds_to: [ :write ] + ([:no_flush] ? [] : [ :flush ]), allow_nil: true razor_server = check_option , :razor_server, type: ::Hash xml_client = check_option , :xml_client, type: ::Hash environment = razor_server[:environment] or raise ArgumentError, "'razor_server/environment' option invalid or missing" space = razor_server[:space] || environment root_space = xml_client[:root_space] or raise ArgumentError, "'xml_client/root_space' option invalid or missing" sns = xml_client[:sns] or raise ArgumentError, "'xml_client/sns' option invalid or missing" cc_xc_rs_server = self.obtain_server_or_throw_ root_space, 'xml_client/root_space' cc_xc_sp_server = self.obtain_server_or_throw_ sns, 'xml_client/sns' cc = <<END_OF_xml <clarite_config> <xml_client> <root_space host="#{cc_xc_rs_server[0]}" port="#{cc_xc_rs_server[1]}"/> <sns> <server host="#{cc_xc_sp_server[0]}" port="#{cc_xc_sp_server[1]}"/> </sns> <ssl> <enabled>false</enabled> <isDefault>false</isDefault> <authenticateServer>false</authenticateServer> <CAFile>ssl/serverCAcert.pem</CAFile> </ssl> <options> <timers> <clientPooledSockets>-1</clientPooledSockets> </timers> </options> </xml_client> <razor_server space="#{space}" environment="#{environment}"/> </clarite_config> END_OF_xml if io io.write cc io.flush unless [:no_flush] end cc end |