Class: Seory::Repository
- Inherits:
-
Object
- Object
- Seory::Repository
- Defined in:
- lib/seory/repository.rb
Instance Method Summary collapse
- #<<(page_contents) ⇒ Object
-
#initialize ⇒ Repository
constructor
A new instance of Repository.
- #lookup(controller) ⇒ Object
Constructor Details
#initialize ⇒ Repository
5 6 7 |
# File 'lib/seory/repository.rb', line 5 def initialize @store = [] end |
Instance Method Details
#<<(page_contents) ⇒ Object
9 10 11 |
# File 'lib/seory/repository.rb', line 9 def <<(page_contents) @store << page_contents end |
#lookup(controller) ⇒ Object
13 14 15 16 |
# File 'lib/seory/repository.rb', line 13 def lookup(controller) page_contents = @store.detect {|page| page.match?(controller) } Seory::Runtime.new(page_contents, controller) end |