Sha256: f71194da4688af0f2393cfb734bc03d142337c4136cbc263e0f271f6670a9df7

Contents?: true

Size: 451 Bytes

Versions: 5

Compression:

Stored size: 451 Bytes

Contents

module Bunch
  class AbstractNode
    def content
      raise NotImplementedError
    end
    alias name content
    alias target_extension content

    def write_to_dir(dir)
      write_to_file(File.join(dir, name))
    end

    def write_to_file(fn)
      out_file = "#{fn}#{target_extension}"
      File.open(out_file, 'w') { |f| f.write(content) }
    end

    protected
      def fetch(fn, &blk)
        Cache.fetch(fn, &blk)
      end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bunch-0.0.11 lib/bunch/abstract_node.rb
bunch-0.0.10 lib/bunch/abstract_node.rb
bunch-0.0.9 lib/bunch/abstract_node.rb
bunch-0.0.8 lib/bunch/abstract_node.rb
bunch-0.0.7 lib/bunch/abstract_node.rb