Class: Qcmd::QLab::CueList

Inherits:
Object
  • Object
show all
Defined in:
lib/qcmd/qlab/cue_list.rb

Overview

All return an array of cue dictionaries:

[ { "uniqueID": string, "number": string "name": string "type": string "colorName": string "flagged": number "armed": number } ]

If the cue is a group, the dictionary will include an array of cue dictionaries for all children in the group:

[ { "uniqueID": string, "number": string "name": string "type": string "colorName": string "flagged": number "armed": number "cues": [ { }, { }, { } ] } ]

[\"uniqueID\":\"1\", \"cues\":[{\"number\":\"1\", \"uniqueID\":\"2\", \"flagged\":false, \"type\":\"Wait\", \"colorName\":\"none\", \"name\":\"boom\", \"armed\":true], "flagged":false, "type":"Group", "colorName":"none", "name":"Main Cue List", "armed":true}]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ CueList

Returns a new instance of CueList.



50
51
52
# File 'lib/qcmd/qlab/cue_list.rb', line 50

def initialize data
  self.data = data
end

Instance Attribute Details

#data ⇒ Object

Returns the value of attribute data.



48
49
50
# File 'lib/qcmd/qlab/cue_list.rb', line 48

def data
  @data
end

Instance Method Details

#cues ⇒ Object



70
71
72
73
74
75
76
# File 'lib/qcmd/qlab/cue_list.rb', line 70

def cues
  if data['cues'].nil?
    []
  else
    data['cues'].map {|c| Qcmd::QLab::Cue.new(c)}
  end
end

#has_cues? ⇒ Boolean

Returns:

  • (Boolean)


78
79
80
# File 'lib/qcmd/qlab/cue_list.rb', line 78

def has_cues?
  cues.size > 0
end

#id ⇒ Object



54
55
56
# File 'lib/qcmd/qlab/cue_list.rb', line 54

def id
  data['uniqueID']
end

#name ⇒ Object



58
59
60
# File 'lib/qcmd/qlab/cue_list.rb', line 58

def name
  data['listName']
end

#number ⇒ Object



62
63
64
# File 'lib/qcmd/qlab/cue_list.rb', line 62

def number
  data['number']
end

#type ⇒ Object



66
67
68
# File 'lib/qcmd/qlab/cue_list.rb', line 66

def type
  data['type']
end