Class: Thirdeye::Workspace

Inherits:
Base
  • Object
show all
Defined in:
lib/thirdeye/workspace.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

i3, #i3

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

#idObject

Returns the value of attribute id.



15
16
17
# File 'lib/thirdeye/workspace.rb', line 15

def id
  @id
end

Class Method Details

.allObject



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

.listObject



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

Returns:

  • (Boolean)


25
26
27
# File 'lib/thirdeye/workspace.rb', line 25

def exists?
  !data.nil?
end

#focused?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/thirdeye/workspace.rb', line 21

def focused?
  data['focused']
end

#nameObject



45
46
47
# File 'lib/thirdeye/workspace.rb', line 45

def name
  data['name']
end

#numObject



41
42
43
# File 'lib/thirdeye/workspace.rb', line 41

def num
  data['num']
end

#outputObject



37
38
39
# File 'lib/thirdeye/workspace.rb', line 37

def output
  data['output']
end

#urgent?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/thirdeye/workspace.rb', line 33

def urgent?
  data['urgent']
end

#visible?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/thirdeye/workspace.rb', line 29

def visible?
  data['visible']
end