Class: Frails::Component::ReactComponent
- Inherits:
-
AbstractComponent
- Object
- AbstractComponent
- Frails::Component::ReactComponent
- Defined in:
- lib/frails/component/react_component.rb
Instance Attribute Summary collapse
-
#class_name ⇒ Object
Returns the value of attribute class_name.
-
#content_loader ⇒ Object
Returns the value of attribute content_loader.
-
#prerender ⇒ Object
Returns the value of attribute prerender.
-
#props ⇒ Object
Returns the value of attribute props.
-
#tag ⇒ Object
Returns the value of attribute tag.
Instance Method Summary collapse
-
#initialize(view, options) ⇒ ReactComponent
constructor
A new instance of ReactComponent.
Methods inherited from AbstractComponent
after_render, before_render, #method_missing
Constructor Details
#initialize(view, options) ⇒ ReactComponent
Returns a new instance of ReactComponent.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/frails/component/react_component.rb', line 6 def initialize(view, ) @view, @options = view, @class_name = @options.fetch(:class, nil) @props = @options.fetch(:props, {}) @tag = @options.fetch(:tag, :div) @prerender = @options.fetch(:prerender, false) @content_loader = @options.fetch(:content_loader, false) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Frails::Component::AbstractComponent
Instance Attribute Details
#class_name ⇒ Object
Returns the value of attribute class_name.
4 5 6 |
# File 'lib/frails/component/react_component.rb', line 4 def class_name @class_name end |
#content_loader ⇒ Object
Returns the value of attribute content_loader.
4 5 6 |
# File 'lib/frails/component/react_component.rb', line 4 def content_loader @content_loader end |
#prerender ⇒ Object
Returns the value of attribute prerender.
4 5 6 |
# File 'lib/frails/component/react_component.rb', line 4 def prerender @prerender end |
#props ⇒ Object
Returns the value of attribute props.
4 5 6 |
# File 'lib/frails/component/react_component.rb', line 4 def props @props end |
#tag ⇒ Object
Returns the value of attribute tag.
4 5 6 |
# File 'lib/frails/component/react_component.rb', line 4 def tag @tag end |