Class: XMLServiceAdapters::AbstractAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/adapters/abstract_adapter.rb

Direct Known Subclasses

IBM_DBAdapter, RESTAdapter

Instance Method Summary collapse

Constructor Details

#initialize(conn, options) ⇒ AbstractAdapter

Returns a new instance of AbstractAdapter.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/adapters/abstract_adapter.rb', line 19

def initialize(conn,options)
  @xml_conn = conn
  @xml_options = options
  if !options.has_key?(:install)
    options[:install] = ActiveXMLService::XINSTALL
  end
  if !options.has_key?(:ctl)
    options[:ctl] = ActiveXMLService::XCTL
  end
  if !options.has_key?(:ipc)
    options[:ipc] = ActiveXMLService::XIPC
  end
  if !options.has_key?(:size)
    options[:size] = ActiveXMLService::XSIZE
  end
  if !options.has_key?(:head)
    options[:head] = ActiveXMLService::XHEAD
  end
  if !options.has_key?(:database)
    options[:database] = ActiveXMLService::XDATABASE
  end
  if !options.has_key?(:username)
    options[:username] = ActiveXMLService::XUSERNAME
  end
  if !options.has_key?(:password)
    options[:password] = ActiveXMLService::XPASSWORD
  end
  @xml_install = options[:install]
  @xml_ctl = options[:ctl]
  @xml_ipc = options[:ipc]
  @xml_size = options[:size]
  @xml_head = options[:head]
  @xml_database = options[:database]
  @xml_username = options[:username]
  @xml_password = options[:password]
  @xml_xmlin = ""
  @xml_xmlin << @xml_head
  @xml_xmlout = ""
  @xml_xmlout << @xml_head
  @xml_doc = nil
end

Instance Method Details

#adapter_nameObject



60
61
62
# File 'lib/adapters/abstract_adapter.rb', line 60

def adapter_name
  'Abstract'
end

#out_docObject



74
75
76
77
78
79
# File 'lib/adapters/abstract_adapter.rb', line 74

def out_doc
  if @xml_doc == nil
    @xml_doc = REXML::Document.new(@xml_xmlout)
  end
  @xml_doc
end

#out_xmlObject



71
72
73
# File 'lib/adapters/abstract_adapter.rb', line 71

def out_xml
  @xml_xmlout
end

#raw_connectionObject



65
66
67
# File 'lib/adapters/abstract_adapter.rb', line 65

def raw_connection
  @xml_conn
end

#raw_optionsObject



68
69
70
# File 'lib/adapters/abstract_adapter.rb', line 68

def raw_options
  @xml_options
end

#xmlservice(callme) ⇒ Object



63
64
# File 'lib/adapters/abstract_adapter.rb', line 63

def xmlservice(callme)
end