Class: HostConnect::AbstractBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/hostconnect/builder.rb

Overview

Abstract class which all the different builder-classes inherit from. The builders are used to produce valid XML requests, which are to be sent to the HostConnect server.

Instance Method Summary collapse

Instance Method Details

#submitObject

Send xml to server. Returns a new object.



11
12
13
14
# File 'lib/hostconnect/builder.rb', line 11

def submit
  obj = ActiveSupport::Inflector.constantize(self.class.to_s.gsub(/Builder/, ''))
  obj.new(Client.post_xml_request(to_s))
end

#to_sObject

String representation of self



6
7
8
# File 'lib/hostconnect/builder.rb', line 6

def to_s
  to_xml.target!
end