Class: Vident::Phlex::Core
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- Vident::Phlex::Core
- Defined in:
- lib/vident/phlex/core.rb
Direct Known Subclasses
Class Attribute Summary collapse
-
.component_source_file_path ⇒ Object
Returns the value of attribute component_source_file_path.
Class Method Summary collapse
-
.current_component_modified_time ⇒ Object
Caching support.
- .inherited(subclass) ⇒ Object
Instance Method Summary collapse
-
#parent_element(**options) ⇒ Object
(also: #root)
Helper to create the main element.
Class Attribute Details
.component_source_file_path ⇒ Object
Returns the value of attribute component_source_file_path.
12 13 14 |
# File 'lib/vident/phlex/core.rb', line 12 def component_source_file_path @component_source_file_path end |
Class Method Details
.current_component_modified_time ⇒ Object
Caching support
15 16 17 18 19 |
# File 'lib/vident/phlex/core.rb', line 15 def current_component_modified_time path = component_source_file_path raise StandardError, "No component source file exists #{path}" unless path && ::File.exist?(path) ::File.mtime(path).to_i.to_s end |
.inherited(subclass) ⇒ Object
7 8 9 10 |
# File 'lib/vident/phlex/core.rb', line 7 def inherited(subclass) subclass.component_source_file_path = caller_locations(1, 10).reject { |l| l.label == "inherited" }[0].path super end |
Instance Method Details
#parent_element(**options) ⇒ Object Also known as: root
Helper to create the main element
23 24 25 |
# File 'lib/vident/phlex/core.rb', line 23 def parent_element(**) @parent_element ||= ::Vident::Phlex::RootComponent.new(**parent_element_attributes()) end |