Class: Ovto::Component

Inherits:
Object
  • Object
show all
Defined in:
lib/ovto/component.rb

Direct Known Subclasses

PureComponent

Defined Under Namespace

Classes: MoreThanOneNode

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(wired_actions) ⇒ Component

Returns a new instance of Component.



16
17
18
19
20
21
22
# File 'lib/ovto/component.rb', line 16

def initialize(wired_actions)
  @wired_actions = wired_actions
  # Initialize here for the unit tests
  @vdom_tree = []
  @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

Instance Method Details

#renderObject



24
25
26
# File 'lib/ovto/component.rb', line 24

def render
  ''
end

#stateObject



28
29
30
# File 'lib/ovto/component.rb', line 28

def state
  @wired_actions._app.state
end