Class: ViewDriver::Sections
- Inherits:
-
Object
- Object
- ViewDriver::Sections
- Defined in:
- lib/view_driver/sections.rb
Instance Attribute Summary collapse
-
#templates ⇒ Object
readonly
Returns the value of attribute templates.
Instance Method Summary collapse
- #==(sections) ⇒ Object
-
#initialize(default_value, options = {}) ⇒ Sections
constructor
A new instance of Sections.
- #template(section) ⇒ Object
Constructor Details
#initialize(default_value, options = {}) ⇒ Sections
Returns a new instance of Sections.
5 6 7 |
# File 'lib/view_driver/sections.rb', line 5 def initialize(default_value, = {}) @templates = convert_to_hash(default_value, ) end |
Instance Attribute Details
#templates ⇒ Object (readonly)
Returns the value of attribute templates.
3 4 5 |
# File 'lib/view_driver/sections.rb', line 3 def templates @templates end |
Instance Method Details
#==(sections) ⇒ Object
13 14 15 |
# File 'lib/view_driver/sections.rb', line 13 def ==(sections) @templates == sections.templates && @templates.default == sections.templates.default end |
#template(section) ⇒ Object
9 10 11 |
# File 'lib/view_driver/sections.rb', line 9 def template(section) @templates[section].normalized_section_template(section) end |