Class: QLab::CueList

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#dataObject

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

#cuesObject



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

#idObject



44
45
46
# File 'lib/qlab-ruby/cue_list.rb', line 44

def id
  data['uniqueID']
end

#nameObject



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

def name
  data['listName']
end

#numberObject



52
53
54
# File 'lib/qlab-ruby/cue_list.rb', line 52

def number
  data['number']
end

#typeObject



56
57
58
# File 'lib/qlab-ruby/cue_list.rb', line 56

def type
  data['type']
end

#workspaceObject



40
41
42
# File 'lib/qlab-ruby/cue_list.rb', line 40

def workspace
  @workspace
end