Class: QLab::CueList
- Inherits:
-
Object
- Object
- QLab::CueList
- Defined in:
- lib/qlab-ruby/cue_list.rb
Overview
An array of cue objects:
[
{
"uniqueID": string,
"number": string
"name": string
"type": string
"colorName": string
"flagged": number
"armed": number
}
]
If a given cue is a group, it will include the nested cues:
[
{
"uniqueID": string,
"number": string
"name": string
"type": string
"colorName": string
"flagged": number
"armed": number
"cues": [ { }, { }, { } ]
}
]
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
- #cues ⇒ Object
- #has_cues? ⇒ Boolean
- #id ⇒ Object
-
#initialize(data, workspace) ⇒ CueList
constructor
Load a cue list with the attributes given in ‘data`.
- #name ⇒ Object
- #number ⇒ Object
- #type ⇒ Object
- #workspace ⇒ Object
Constructor Details
#initialize(data, workspace) ⇒ CueList
Load a cue list with the attributes given in ‘data`
35 36 37 38 |
# File 'lib/qlab-ruby/cue_list.rb', line 35 def initialize data, workspace self.data = data @workspace = workspace end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
32 33 34 |
# File 'lib/qlab-ruby/cue_list.rb', line 32 def data @data end |
Instance Method Details
#cues ⇒ Object
60 61 62 63 64 65 66 |
# File 'lib/qlab-ruby/cue_list.rb', line 60 def cues if data['cues'].nil? [] else data['cues'].map {|c| QLab::Cue.new(c, self)} end end |
#has_cues? ⇒ Boolean
68 69 70 |
# File 'lib/qlab-ruby/cue_list.rb', line 68 def has_cues? cues.size > 0 end |
#id ⇒ Object
44 45 46 |
# File 'lib/qlab-ruby/cue_list.rb', line 44 def id data['uniqueID'] end |
#name ⇒ Object
48 49 50 |
# File 'lib/qlab-ruby/cue_list.rb', line 48 def name data['listName'] end |
#number ⇒ Object
52 53 54 |
# File 'lib/qlab-ruby/cue_list.rb', line 52 def number data['number'] end |
#type ⇒ Object
56 57 58 |
# File 'lib/qlab-ruby/cue_list.rb', line 56 def type data['type'] end |
#workspace ⇒ Object
40 41 42 |
# File 'lib/qlab-ruby/cue_list.rb', line 40 def workspace @workspace end |