Class: Vident::Phlex::HTML

Inherits:
Phlex::HTML
  • Object
show all
Includes:
Component
Defined in:
lib/vident/phlex/html.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.attribute(name, **options) ⇒ Object

Phlex uses a DSL to define the document, and those methods could easily clash with our attribute accessors. Therefore in Phlex components we do not create attribute accessors, and instead use instance variables directly.



12
13
14
15
# File 'lib/vident/phlex/html.rb', line 12

def attribute(name, **options)
  options[:delegates] = false
  super
end

Instance Method Details

#parent_element(**options) ⇒ Object Also known as: root

Helper to create the main element



19
20
21
# File 'lib/vident/phlex/html.rb', line 19

def parent_element(**options)
  @parent_element ||= RootComponent.new(**parent_element_attributes(options))
end