Class: Ovto::App

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeApp

Returns a new instance of App



8
9
10
11
# File 'lib/ovto/app.rb', line 8

def initialize
  @state = self.class.const_get('State').new
  @wired_actions = nil
end

Instance Attribute Details

#stateObject (readonly)

Returns the value of attribute state



12
13
14
# File 'lib/ovto/app.rb', line 12

def state
  @state
end

Class Method Details

.run(*args) ⇒ Object

Create an App and start it



4
5
6
# File 'lib/ovto/app.rb', line 4

def self.run(*args)
  new.run(*args)
end

Instance Method Details

#_set_state(new_state) ⇒ Object

Internal use only



19
20
21
# File 'lib/ovto/app.rb', line 19

def _set_state(new_state)
  @state = new_state
end

#actionsObject



14
15
16
# File 'lib/ovto/app.rb', line 14

def actions
  @wired_actions
end

#run(*args) ⇒ Object

Start this app



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

def run(*args)
  Ovto.log_error{ _run(*args) }
end

#setupObject

Called when this app is started



29
30
31
# File 'lib/ovto/app.rb', line 29

def setup
  # override this if needed
end