lib/massive_sitemap/writer/base.rb in massive_sitemap-2.0.0.rc3 vs lib/massive_sitemap/writer/base.rb in massive_sitemap-2.0.0.rc4
- old
+ new
@@ -9,26 +9,10 @@
def initialize(options = {})
@options = self.class::OPTS.merge(options)
@stream = nil
end
- # Interface
- def open_stream
- @string ||= StringIO.new
- end
-
- def close_stream(stream)
- end
-
- def init?
- true
- end
-
- def streams
- []
- end
-
# API
def init!(options = {})
close!
@options.merge!(options)
if init?
@@ -51,9 +35,38 @@
@stream.print(string) if inited?
end
def each(&block)
streams.each(&block)
+ end
+
+ def current
+ stream
+ end
+
+ # def flush!
+ # @streams = []
+ # end
+
+ # Interface
+ protected
+ def open_stream
+ @string ||= StringIO.new
+ end
+
+ def close_stream(stream)
+ end
+
+ def init?
+ true
+ end
+
+ def streams
+ @streams ||= []
+ end
+
+ def stream
+ nil
end
end
end
end