Class: Thirdeye::Workspace
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
- #exists? ⇒ Boolean
- #focused? ⇒ Boolean
-
#initialize(id) ⇒ Workspace
constructor
A new instance of Workspace.
- #name ⇒ Object
- #num ⇒ Object
- #output ⇒ Object
- #urgent? ⇒ Boolean
- #visible? ⇒ Boolean
Methods inherited from Base
Constructor Details
#initialize(id) ⇒ Workspace
Returns a new instance of Workspace.
17 18 19 |
# File 'lib/thirdeye/workspace.rb', line 17 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
15 16 17 |
# File 'lib/thirdeye/workspace.rb', line 15 def id @id end |
Class Method Details
.all ⇒ Object
4 5 6 7 8 |
# File 'lib/thirdeye/workspace.rb', line 4 def all i3.get_workspaces.collect do |ws| self.new(ws['num'] || ws['name']) end end |
.list ⇒ Object
10 11 12 |
# File 'lib/thirdeye/workspace.rb', line 10 def list self.all.collect{|ws| ws.name || ws.num} end |
Instance Method Details
#exists? ⇒ Boolean
25 26 27 |
# File 'lib/thirdeye/workspace.rb', line 25 def exists? !data.nil? end |
#focused? ⇒ Boolean
21 22 23 |
# File 'lib/thirdeye/workspace.rb', line 21 def focused? data['focused'] end |
#name ⇒ Object
45 46 47 |
# File 'lib/thirdeye/workspace.rb', line 45 def name data['name'] end |
#num ⇒ Object
41 42 43 |
# File 'lib/thirdeye/workspace.rb', line 41 def num data['num'] end |
#output ⇒ Object
37 38 39 |
# File 'lib/thirdeye/workspace.rb', line 37 def output data['output'] end |
#urgent? ⇒ Boolean
33 34 35 |
# File 'lib/thirdeye/workspace.rb', line 33 def urgent? data['urgent'] end |
#visible? ⇒ Boolean
29 30 31 |
# File 'lib/thirdeye/workspace.rb', line 29 def visible? data['visible'] end |