Class: XMLService::I_SH
Overview
xmlservice call SH
Instance Attribute Summary
Attributes inherited from I_CALL
Instance Method Summary collapse
-
#initialize(sh, options = nil) ⇒ I_SH
constructor
A new instance of I_SH.
- #parse_diag_attr ⇒ Object
- #parse_output_attr ⇒ Object
- #to_xml ⇒ Object
Methods inherited from I_CALL
#call, #call_recursive, #dump, #dump_all, #dump_error, #dump_inspect, #dump_inspect_input, #dump_inspect_response, #dump_inspect_returndata, #execute, #format_inspect, #format_inspect_include, #format_inspect_recursive, #out_xml, #parse_return_attr, #reserved_words, #response, #returndata, #xmlservice, #xmlservice_diag_parse, #xmlservice_error
Methods inherited from I_Meta
#add_user_accessor, #instance_variable_forward_get, #instance_variable_forward_set, #parse_return_attr, #remove_user_accessor, #shortCut
Constructor Details
#initialize(sh, options = nil) ⇒ I_SH
Returns a new instance of I_SH.
2344 2345 2346 2347 |
# File 'lib/xmlservice.rb', line 2344 def initialize(sh,=nil) @xml_sh = sh super() end |
Instance Method Details
#parse_diag_attr ⇒ Object
2366 2367 2368 |
# File 'lib/xmlservice.rb', line 2366 def parse_diag_attr() return self.xmlservice_diag_parse("/myscript/sh") end |
#parse_output_attr ⇒ Object
2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 |
# File 'lib/xmlservice.rb', line 2348 def parse_output_attr() super() row = Array.new isrow = false @xml_doc.elements.each("/myscript/sh/row") do |element| row[row.count] = element.text isrow = true end if isrow @response.add_user_accessor("output", row) else text = "*NONE" @xml_doc.elements.each("/myscript/sh") do |element| text = element.text end @response.add_user_accessor("output", text) end end |
#to_xml ⇒ Object
2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 |
# File 'lib/xmlservice.rb', line 2369 def to_xml rows = "" error = " error='fast'" if @xml_options if @xml_options.has_key?(:error) error = " error='#{@xml_options[:error]}'" end if @xml_options.has_key?(:rows) error = " rows='#{@xml_options[:rows]}'" end end xml = "<sh #{rows}#{error}>" xml << @xml_sh.to_s xml << "</sh>\n" xml end |