Class: ViewDriver::Sections

Inherits:
Object
  • Object
show all
Defined in:
lib/view_driver/sections.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = {})
  @templates = convert_to_hash(default_value, options)
end

Instance Attribute Details

#templatesObject (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