Sha256: ab44f4c9757549789bf5d94c7c96b6f653b5d8ce87b37c0f6756824ed846e5ae

Contents?: true

Size: 375 Bytes

Versions: 3

Compression:

Stored size: 375 Bytes

Contents

module Orthor
  class Templates
    class << self
      attr_accessor :templates

      def define(&blk)
        @templates = {}
        class_eval &blk
      end

      def template(name, markup)
        @templates[name.to_s] = markup
      end
      alias :add :template

      def [](key)
        @templates ||= {}
        @templates[key.to_s]
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
orthorings-0.4.2 lib/orthor/templates.rb
orthorings-0.4.1 lib/orthor/templates.rb
orthorings-0.4.0 lib/orthor/templates.rb