Class: Ovto::Component
- Inherits:
-
Object
- Object
- Ovto::Component
- Defined in:
- lib/ovto/component.rb
Direct Known Subclasses
Defined Under Namespace
Classes: MoreThanOneNode
Class Method Summary collapse
- .hash_to_js_obj(hash) ⇒ Object
-
.middleware_name ⇒ Object
(internal) Defined for convenience.
Instance Method Summary collapse
-
#initialize(wired_action_set, middleware_path = []) ⇒ Component
constructor
A new instance of Component.
- #render ⇒ Object
- #state ⇒ Object
Constructor Details
#initialize(wired_action_set, middleware_path = []) ⇒ Component
Returns a new instance of Component.
21 22 23 24 25 26 27 28 |
# File 'lib/ovto/component.rb', line 21 def initialize(wired_action_set, middleware_path=[]) @wired_action_set = wired_action_set || WiredActionSet.dummy @middleware_path = middleware_path # Initialize here for the unit tests @vdom_stack = [[]] @components = [] @components_index = 0 end |
Class Method Details
.hash_to_js_obj(hash) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/ovto/component.rb', line 8 def self.hash_to_js_obj(hash) ret = `{}` hash.each do |k, v| `ret[k] = v` end ret end |
.middleware_name ⇒ Object
(internal) Defined for convenience
17 18 19 |
# File 'lib/ovto/component.rb', line 17 def self.middleware_name WiredActionSet::I_AM_APP_NOT_A_MIDDLEWARE end |
Instance Method Details
#render ⇒ Object
30 31 32 |
# File 'lib/ovto/component.rb', line 30 def render '' end |
#state ⇒ Object
34 35 36 |
# File 'lib/ovto/component.rb', line 34 def state @wired_action_set.app.state end |