Sha256: f1fc389e5857f1ee0281538be7cdffd132300b52ae5df71b5a2a9261c4d55077

Contents?: true

Size: 1.7 KB

Versions: 12

Compression:

Stored size: 1.7 KB

Contents

module Qcmd
  module QLab
    #  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": [ { }, { }, { } ]
    #      }
    #  ]
    #
    #  [{\"number\":\"\",
    #    \"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}]

    class CueList
      attr_accessor :data

      def initialize data
        self.data = data
      end

      def id
        data['uniqueID']
      end

      def name
        data['listName']
      end

      def number
        data['number']
      end

      def type
        data['type']
      end

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

      def has_cues?
        cues.size > 0
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
qcmd-0.2.0 lib/qcmd/qlab/cue_list.rb
qcmd-0.1.16 lib/qcmd/qlab/cue_list.rb
qcmd-0.1.16.pre2 lib/qcmd/qlab/cue_list.rb
qcmd-0.1.16.pre lib/qcmd/qlab/cue_list.rb
qcmd-0.1.15 lib/qcmd/qlab/cue_list.rb
qcmd-0.1.14 lib/qcmd/qlab/cue_list.rb
qcmd-0.1.13 lib/qcmd/qlab/cue_list.rb
qcmd-0.1.12 lib/qcmd/qlab/cue_list.rb
qcmd-0.1.11 lib/qcmd/qlab/cue_list.rb
qcmd-0.1.10 lib/qcmd/qlab/cue_list.rb
qcmd-0.1.9 lib/qcmd/qlab/cue_list.rb
qcmd-0.1.8 lib/qcmd/qlab/cue_list.rb