Sha256: 9737db363ee02c870ae9764db79ce623368a33c2b56458756e94eea962f561aa

Contents?: true

Size: 514 Bytes

Versions: 4

Compression:

Stored size: 514 Bytes

Contents

module Slippers
  class TemplateGroup
    def initialize(params={})
      @templates = params[:templates]
      @super_group = params[:super_group]
    end
    
    def find(subtemplate)
      return nil unless @templates
      return @templates[subtemplate.to_sym] if @templates.include?(subtemplate.to_sym)
      find_in_super_group(subtemplate)
    end
    
    private
      def find_in_super_group(subtemplate)
        return nil unless @super_group 
        @super_group.find(subtemplate)
      end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
starapor-slippers-0.0.0 lib/engine/template_group.rb
starapor-slippers-0.0.1 lib/engine/template_group.rb
starapor-slippers-0.0.2 lib/engine/template_group.rb
starapor-slippers-0.0.3 lib/engine/template_group.rb