class Thirdeye::Workspace

Attributes

id[RW]

Public Class Methods

all() click to toggle source
# File lib/thirdeye/workspace.rb, line 4
def all
  i3.get_workspaces.collect do |ws|
    self.new(ws['num'] || ws['name'])
  end
end
list() click to toggle source
# File lib/thirdeye/workspace.rb, line 10
def list
  self.all.collect{|ws| ws.name || ws.num}
end
new(id) click to toggle source
# File lib/thirdeye/workspace.rb, line 17
def initialize(id)
  @id = id
end

Public Instance Methods

exists?() click to toggle source
# File lib/thirdeye/workspace.rb, line 25
def exists?
  !data.nil?
end
focused?() click to toggle source
# File lib/thirdeye/workspace.rb, line 21
def focused?
  data['focused']
end
name() click to toggle source
# File lib/thirdeye/workspace.rb, line 45
def name
  data['name']
end
num() click to toggle source
# File lib/thirdeye/workspace.rb, line 41
def num
  data['num']
end
output() click to toggle source
# File lib/thirdeye/workspace.rb, line 37
def output
  data['output']
end
urgent?() click to toggle source
# File lib/thirdeye/workspace.rb, line 33
def urgent?
  data['urgent']
end
visible?() click to toggle source
# File lib/thirdeye/workspace.rb, line 29
def visible?
  data['visible']
end

Protected Instance Methods

data() click to toggle source
# File lib/thirdeye/workspace.rb, line 51
def data
  i3.get_workspaces.detect do |ws|
    [ws['num'],ws['name']].include? id
  end
end