Method: WAX#close

Defined in:
lib/wax.rb

#closeObject

Terminates all unterminated elements, closes the Writer that is being used to output XML, and insures that nothing else can be written.



157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/wax.rb', line 157

def close
  raise "already closed" unless @writer
  bad_state("close") if @check_me and @state == :in_prolog

  # End all the unended elements.
  while @parent_stack.size > 0; end!; end

  if @close_stream
    @writer.close
  else
    @writer.flush
  end

  @writer = nil
end