Class: Seory::Repository
- Inherits:
-
Object
- Object
- Seory::Repository
- Defined in:
- lib/seory/repository.rb
Instance Attribute Summary collapse
-
#helper ⇒ Object
Returns the value of attribute helper.
Class Method Summary collapse
Instance Method Summary collapse
- #<<(page_group) ⇒ Object
- #default ⇒ Object
-
#initialize ⇒ Repository
constructor
A new instance of Repository.
- #lookup(controller) ⇒ Object
Constructor Details
#initialize ⇒ Repository
Returns a new instance of Repository.
15 16 17 |
# File 'lib/seory/repository.rb', line 15 def initialize @page_groups = [] end |
Instance Attribute Details
#helper ⇒ Object
Returns the value of attribute helper.
13 14 15 |
# File 'lib/seory/repository.rb', line 13 def helper @helper end |
Class Method Details
.extract_label_from_trace(trace) ⇒ Object
8 9 10 |
# File 'lib/seory/repository.rb', line 8 def extract_label_from_trace(trace) trace.first.split(':').first end |
Instance Method Details
#<<(page_group) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/seory/repository.rb', line 19 def <<(page_group) remove_old_group!(page_group.name) @page_groups << page_group clear_page_order_pre_calculation! end |
#default ⇒ Object
35 36 37 38 39 40 |
# File 'lib/seory/repository.rb', line 35 def default @default ||= @page_groups.map(&:default).compact.tap {|defaults| raise DuplicateDefault if defaults.size > 1 }.first end |