Class: Alchemy::Element::DomId

Inherits:
Object
  • Object
show all
Defined in:
app/models/alchemy/element/dom_id.rb

Instance Method Summary collapse

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

#callObject



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