Class: ClickAndSend::XML

Inherits:
Object
  • Object
show all
Defined in:
lib/click_and_send/xml.rb

Instance Method Summary collapse

Constructor Details

#initialize(input, options = {}) ⇒ XML

Returns a new instance of XML.



3
4
5
6
# File 'lib/click_and_send/xml.rb', line 3

def initialize(input, options = {})
  @input = input
  @options = options
end

Instance Method Details

#to_xmlObject



8
9
10
11
12
13
14
# File 'lib/click_and_send/xml.rb', line 8

def to_xml
  xml = Gyoku.xml(@input)
  if @options[:strip_inner_tags]
    @options[:strip_inner_tags].each { |tag| xml.gsub!("</#{tag}><#{tag}>", '') }
  end
  xml
end