Class: Skyfall::Firehose::LabelsMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/skyfall/firehose/labels_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type_object, data_object) ⇒ LabelsMessage

Returns a new instance of LabelsMessage.



11
12
13
14
15
16
17
# File 'lib/skyfall/firehose/labels_message.rb', line 11

def initialize(type_object, data_object)
  @type_object = type_object
  @data_object = data_object

  @type = @type_object['t'][1..-1].to_sym
  @seq = @data_object['seq']
end

Instance Attribute Details

#data_objectObject (readonly)

Returns the value of attribute data_object.



8
9
10
# File 'lib/skyfall/firehose/labels_message.rb', line 8

def data_object
  @data_object
end

#seqObject (readonly)

Returns the value of attribute seq.



9
10
11
# File 'lib/skyfall/firehose/labels_message.rb', line 9

def seq
  @seq
end

#typeObject (readonly)

Returns the value of attribute type.



9
10
11
# File 'lib/skyfall/firehose/labels_message.rb', line 9

def type
  @type
end

#type_objectObject (readonly)

Returns the value of attribute type_object.



8
9
10
# File 'lib/skyfall/firehose/labels_message.rb', line 8

def type_object
  @type_object
end

Instance Method Details

#labelsObject



19
20
21
# File 'lib/skyfall/firehose/labels_message.rb', line 19

def labels
  @labels ||= @data_object['labels'].map { |x| Label.new(x) }
end