Skip to content

Commit

Permalink
Add Template.paths as list of registered templates (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 24, 2013
1 parent 1eef4d8 commit 515efb9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/opal/template/paths_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'spec_helper'
require 'template'

describe Template do
describe ".paths" do
it "should be an array of registered templates" do
Template.paths.should be_kind_of(Array)
end
end
end
4 changes: 4 additions & 0 deletions stdlib/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ def self.[]=(name, instance)
@_cache[name] = instance
end

def self.paths
@_cache.keys
end

attr_reader :body

def initialize(name, &body)
Expand Down

0 comments on commit 515efb9

Please sign in to comment.