Class: Ruact::Flight::ReactElement
- Inherits:
-
Object
- Object
- Ruact::Flight::ReactElement
- Defined in:
- lib/ruact/flight/react_element.rb
Overview
Represents a React element: <div>, <Component>, etc. Wire format: [“$”, type, key, props]
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#props ⇒ Object
readonly
Returns the value of attribute props.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type:, key: nil, props: {}) ⇒ ReactElement
constructor
A new instance of ReactElement.
Constructor Details
#initialize(type:, key: nil, props: {}) ⇒ ReactElement
Returns a new instance of ReactElement.
10 11 12 13 14 |
# File 'lib/ruact/flight/react_element.rb', line 10 def initialize(type:, key: nil, props: {}) @type = type @key = key @props = props end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
8 9 10 |
# File 'lib/ruact/flight/react_element.rb', line 8 def key @key end |
#props ⇒ Object (readonly)
Returns the value of attribute props.
8 9 10 |
# File 'lib/ruact/flight/react_element.rb', line 8 def props @props end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/ruact/flight/react_element.rb', line 8 def type @type end |