Class: QLab::Cue

Inherits:
Communicator show all
Defined in:
lib/qlab-ruby/cue.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Communicator

#send_message

Constructor Details

#initialize(data, cue_list) ⇒ Cue

Load a cue with the attributes given in ‘data`



6
7
8
9
# File 'lib/qlab-ruby/cue.rb', line 6

def initialize data, cue_list
  self.data = data
  @cue_list = cue_list
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



3
4
5
# File 'lib/qlab-ruby/cue.rb', line 3

def data
  @data
end

Instance Method Details

#==(other) ⇒ Object

Compare with another Cue.



62
63
64
65
66
67
68
# File 'lib/qlab-ruby/cue.rb', line 62

def ==(other)
  if other.is_a?(Cue)
    self.data = other.data
  else
    false
  end
end

#cuesObject

Get the list of nested cues.



53
54
55
56
57
58
59
# File 'lib/qlab-ruby/cue.rb', line 53

def cues
  if data['cues'].nil?
    []
  else
    data['cues'].map {|c| Cue.new(c, @cue_list)}
  end
end

#has_cues?Boolean

Check whether this cue has nested cues.

Returns:

  • (Boolean)


48
49
50
# File 'lib/qlab-ruby/cue.rb', line 48

def has_cues?
  cues.size > 0
end

#idObject

The cue’s ‘uniqueID`.



43
44
45
# File 'lib/qlab-ruby/cue.rb', line 43

def id
  data['uniqueID']
end

#workspaceObject

A reference to the cue’s workspace.



71
72
73
# File 'lib/qlab-ruby/cue.rb', line 71

def workspace
  @cue_list.workspace
end