Class: Well::Element
Overview
Class representing BEM element component.
Instance Attribute Summary
Attributes included from Component
Instance Method Summary collapse
- #base ⇒ Block, Element
-
#compiled_identifier ⇒ String
Builds CSS class representing BEM element component.
-
#initialize(base, tag_name, identifier, opts = {}) ⇒ Element
constructor
A new instance of Element.
Methods included from Component
#element, #evaluate, #modified_identifier, #modifier, #other_classes, #output_buffer, #output_classes
Constructor Details
#initialize(base, tag_name, identifier, opts = {}) ⇒ Element
Returns a new instance of Element.
14 15 16 |
# File 'lib/well/element.rb', line 14 def initialize(base, tag_name, identifier, opts = {}) @base, @tag_name, @identifier, @opts = base, tag_name, identifier, opts end |
Instance Method Details
#base ⇒ Block, Element
The base evaludation context for a BEM element can be either a Block or an Well::Element.
21 22 23 |
# File 'lib/well/element.rb', line 21 def base @base end |
#compiled_identifier ⇒ String
Builds CSS class representing BEM element component.
27 28 29 30 31 |
# File 'lib/well/element.rb', line 27 def compiled_identifier ids = [base.identifier] ids << Well.config.element_separator << identifier ids.join end |