Class: Styleus::ViewComponent
- Defined in:
- app/models/styleus/view_component.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#id ⇒ Object
id is used as anchor id in the anchor menu, so it has to be a uid.
Methods inherited from Base
#initialize, #to_key, with_attributes
Constructor Details
This class inherits a constructor from Styleus::Base
Class Method Details
.components ⇒ Object
13 14 15 |
# File 'app/models/styleus/view_component.rb', line 13 def components @components ||= [] end |
.from_hashes(hashes) ⇒ Object
17 18 19 20 21 |
# File 'app/models/styleus/view_component.rb', line 17 def from_hashes(hashes) components.clear hashes.each { |comp_hash| components << new(comp_hash) } components end |
Instance Method Details
#id ⇒ Object
id is used as anchor id in the anchor menu, so it has to be a uid. TODO: make sure the uid-ness :)
8 9 10 |
# File 'app/models/styleus/view_component.rb', line 8 def id headline.underscore end |