Class: Alchemy::Element::DomId
- Inherits:
-
Object
- Object
- Alchemy::Element::DomId
- Defined in:
- app/models/alchemy/element/dom_id.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(element) ⇒ DomId
constructor
A new instance of DomId.
Constructor Details
#initialize(element) ⇒ DomId
Returns a new instance of DomId.
16 17 18 19 |
# File 'app/models/alchemy/element/dom_id.rb', line 16 def initialize(element) @element = element @parent_element = element.parent_element end |
Instance Method Details
#call ⇒ Object
21 22 23 |
# File 'app/models/alchemy/element/dom_id.rb', line 21 def call [parent_element&.dom_id, element.name, element.position].compact.join("-") end |