Class: QLab::Cue
- Inherits:
-
Communicator
- Object
- Communicator
- QLab::Cue
- Defined in:
- lib/qlab-ruby/cue.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Compare with another Cue.
-
#cues ⇒ Object
Get the list of nested cues.
-
#has_cues? ⇒ Boolean
Check whether this cue has nested cues.
-
#id ⇒ Object
The cue’s ‘uniqueID`.
-
#initialize(data, cue_list) ⇒ Cue
constructor
Load a cue with the attributes given in ‘data`.
-
#workspace ⇒ Object
A reference to the cue’s workspace.
Methods inherited from Communicator
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
#data ⇒ Object
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 |
#cues ⇒ Object
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.
48 49 50 |
# File 'lib/qlab-ruby/cue.rb', line 48 def has_cues? cues.size > 0 end |
#id ⇒ Object
The cue’s ‘uniqueID`.
43 44 45 |
# File 'lib/qlab-ruby/cue.rb', line 43 def id data['uniqueID'] end |
#workspace ⇒ Object
A reference to the cue’s workspace.
71 72 73 |
# File 'lib/qlab-ruby/cue.rb', line 71 def workspace @cue_list.workspace end |