Sha256: 052158f621819ecc3ddf9966fe58c5d6d0edbc8064b560ffcff62c2a02703ca9

Contents?: true

Size: 659 Bytes

Versions: 2

Compression:

Stored size: 659 Bytes

Contents

module Munge
  class Application
    def initialize(system)
      @system = system
    end

    def items
      @system.items
    end

    def nonrouted
      items.select { |item| item.route.nil? }
    end

    def routed
      items.reject { |item| item.route.nil? }
    end

    def build_virtual_item(relpath, content, **frontmatter)
      @system.items.build(relpath: relpath, content: content, frontmatter: frontmatter)
    end

    def create(*args)
      item = build_virtual_item(*args)
      yield item if block_given?
      @system.items.push(item)
    end

    def vomit(component_name)
      @system.public_send(component_name)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
munge-0.7.1 lib/munge/application.rb
munge-0.7.0 lib/munge/application.rb