Module: Tea::App

Defined in:
lib/tea/m_event_app.rb

Defined Under Namespace

Classes: Exit, Minimized, Restored

Class Method Summary collapse

Class Method Details

.update_state(tea_event) ⇒ Object

Update the reported app state when a Tea event is retrieved, so App.visible? returns the right status. Called automatically by Event.get.



53
54
55
56
57
58
59
# File 'lib/tea/m_event_app.rb', line 53

def App.update_state(tea_event)
  case tea_event
  when Minimized then @visible = false
  when Restored  then @visible = true
  end
  @visible
end

.visible?Boolean

Returns true if the screen window has not been minimised, otherwise false.

Returns:

  • (Boolean)


46
47
48
# File 'lib/tea/m_event_app.rb', line 46

def App.visible?
  @visible
end