Module: Porous::Component
- Includes:
- Render, Virtual, Injection, VirtualDOM::DOM
- Included in:
- Home, Application, Router
- Defined in:
- lib/porous/component.rb,
lib/porous/component/render.rb,
lib/porous/component/virtual.rb,
lib/porous/component/class_methods.rb
Defined Under Namespace
Modules: ClassMethods, Render, Virtual
Constant Summary
Constants included from VirtualDOM::DOM
VirtualDOM::DOM::HTML_TAGS, VirtualDOM::DOM::SVG_TAGS
Instance Attribute Summary
Attributes included from Injection
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Injection
#init, #init_injections, #inject, #with_root_component
Methods included from Render
#before_render, #render, #render_virtual_dom
Methods included from Virtual
Methods included from VirtualDOM::DOM
#class_names, #merge_string, #method_missing, #process_params, #process_tag, #text, #to_vnode
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class VirtualDOM::DOM
Class Method Details
.included(base) ⇒ Object
10 11 12 |
# File 'lib/porous/component.rb', line 10 def self.included(base) base.extend Porous::Component::ClassMethods end |
Instance Method Details
#initialize(props = {}) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/porous/component.rb', line 14 def initialize(props = {}) @props = props @root_component = self init_injections inject @virtual_dom = render_virtual_dom end |
#props ⇒ Object
22 23 24 |
# File 'lib/porous/component.rb', line 22 def props @props || {} end |
#to_s ⇒ Object
31 32 33 |
# File 'lib/porous/component.rb', line 31 def to_s @virtual_dom.to_s end |
#with_props(props) ⇒ Object
26 27 28 29 |
# File 'lib/porous/component.rb', line 26 def with_props(props) @props = props self end |