Sha256: c67328e3fee6c2cc9d251dbae77e9f7c4d098811a1dae5ac1a50367b4afd5afd

Contents?: true

Size: 602 Bytes

Versions: 1

Compression:

Stored size: 602 Bytes

Contents

module Dozuki
  module XML
    class NodeCollection
      attr_accessor :collection
      
      def initialize(collection)
        self.collection = collection
      end
      
      def as_node(&blk)
        collection.each{|item| blk.call(Node.new(item))}
      end
      
      def as_string(&blk)
        collection.each{|item| blk.call(Parser.to_string(item))}
      end
      
      def as_int(&blk)
        collection.each{|item| blk.call(Parser.to_int(item))}
      end
      
      def as_float(&blk)
        collection.each{|item| blk.call(Parser.to_float(item))}
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dozuki-0.0.1 lib/dozuki/xml/node_collection.rb