Class: Krakow::Command::Identify

Inherits:
Krakow::Command show all
Defined in:
lib/krakow/command/identify.rb

Overview

Update client metadata on server / negotiate features

Instance Attribute Summary (collapse)

Attributes (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Krakow::FrameType) response Originally defined in class Krakow::Command

Returns response to command

Returns:

Class Method Details

+ (Object) error



47
48
49
# File 'lib/krakow/command/identify.rb', line 47

def error
  %w(E_INVALID E_BAD_BODY)
end

+ (Object) ok



43
44
45
# File 'lib/krakow/command/identify.rb', line 43

def ok
  %w(OK)
end

Instance Method Details

- ([TrueClass, FalseClass]) deflate

Returns the deflate attribute

Returns:

  • ([TrueClass, FalseClass])

    the deflate attribute



24
# File 'lib/krakow/command/identify.rb', line 24

attribute :deflate, [TrueClass, FalseClass]

- (TrueClass, FalseClass) deflate?

Returns truthiness of the deflate attribute

Returns:

  • (TrueClass, FalseClass)

    truthiness of the deflate attribute



24
# File 'lib/krakow/command/identify.rb', line 24

attribute :deflate, [TrueClass, FalseClass]

- (Integer) deflate_level

Returns the deflate_level attribute

Returns:

  • (Integer)

    the deflate_level attribute



25
# File 'lib/krakow/command/identify.rb', line 25

attribute :deflate_level, Integer

- (TrueClass, FalseClass) deflate_level?

Returns truthiness of the deflate_level attribute

Returns:

  • (TrueClass, FalseClass)

    truthiness of the deflate_level attribute



25
# File 'lib/krakow/command/identify.rb', line 25

attribute :deflate_level, Integer

- ([TrueClass, FalseClass]) feature_negotiation

Returns the feature_negotiation attribute

Returns:

  • ([TrueClass, FalseClass])

    the feature_negotiation attribute



18
# File 'lib/krakow/command/identify.rb', line 18

attribute :feature_negotiation, [TrueClass, FalseClass]

- (TrueClass, FalseClass) feature_negotiation?

Returns truthiness of the feature_negotiation attribute

Returns:

  • (TrueClass, FalseClass)

    truthiness of the feature_negotiation attribute



18
# File 'lib/krakow/command/identify.rb', line 18

attribute :feature_negotiation, [TrueClass, FalseClass]

- (Numeric) heartbeat_interval

Returns the heartbeat_interval attribute

Returns:

  • (Numeric)

    the heartbeat_interval attribute



19
# File 'lib/krakow/command/identify.rb', line 19

attribute :heartbeat_interval, Numeric

- (TrueClass, FalseClass) heartbeat_interval?

Returns truthiness of the heartbeat_interval attribute

Returns:

  • (TrueClass, FalseClass)

    truthiness of the heartbeat_interval attribute



19
# File 'lib/krakow/command/identify.rb', line 19

attribute :heartbeat_interval, Numeric

- ([String, Numeric]) long_id

Returns the long_id attribute

Returns:

  • ([String, Numeric])

    the long_id attribute



17
# File 'lib/krakow/command/identify.rb', line 17

attribute :long_id, [String, Numeric], :required => true

- (TrueClass, FalseClass) long_id?

Returns truthiness of the long_id attribute

Returns:

  • (TrueClass, FalseClass)

    truthiness of the long_id attribute



17
# File 'lib/krakow/command/identify.rb', line 17

attribute :long_id, [String, Numeric], :required => true

- (Integer) output_buffer_size

Returns the output_buffer_size attribute

Returns:

  • (Integer)

    the output_buffer_size attribute



20
# File 'lib/krakow/command/identify.rb', line 20

attribute :output_buffer_size, Integer

- (TrueClass, FalseClass) output_buffer_size?

Returns truthiness of the output_buffer_size attribute

Returns:

  • (TrueClass, FalseClass)

    truthiness of the output_buffer_size attribute



20
# File 'lib/krakow/command/identify.rb', line 20

attribute :output_buffer_size, Integer

- (Integer) output_buffer_timeout

Returns the output_buffer_timeout attribute

Returns:

  • (Integer)

    the output_buffer_timeout attribute



21
# File 'lib/krakow/command/identify.rb', line 21

attribute :output_buffer_timeout, Integer

- (TrueClass, FalseClass) output_buffer_timeout?

Returns truthiness of the output_buffer_timeout attribute

Returns:

  • (TrueClass, FalseClass)

    truthiness of the output_buffer_timeout attribute



21
# File 'lib/krakow/command/identify.rb', line 21

attribute :output_buffer_timeout, Integer

- (Integer) sample_rate

Returns the sample_rate attribute

Returns:

  • (Integer)

    the sample_rate attribute



26
# File 'lib/krakow/command/identify.rb', line 26

attribute :sample_rate, Integer

- (TrueClass, FalseClass) sample_rate?

Returns truthiness of the sample_rate attribute

Returns:

  • (TrueClass, FalseClass)

    truthiness of the sample_rate attribute



26
# File 'lib/krakow/command/identify.rb', line 26

attribute :sample_rate, Integer

- ([String, Numeric]) short_id

Returns the short_id attribute

Returns:

  • ([String, Numeric])

    the short_id attribute



16
# File 'lib/krakow/command/identify.rb', line 16

attribute :short_id, [String, Numeric], :required => true

- (TrueClass, FalseClass) short_id?

Returns truthiness of the short_id attribute

Returns:

  • (TrueClass, FalseClass)

    truthiness of the short_id attribute



16
# File 'lib/krakow/command/identify.rb', line 16

attribute :short_id, [String, Numeric], :required => true

- ([TrueClass, FalseClass]) snappy

Returns the snappy attribute

Returns:

  • ([TrueClass, FalseClass])

    the snappy attribute



23
# File 'lib/krakow/command/identify.rb', line 23

attribute :snappy, [TrueClass, FalseClass]

- (TrueClass, FalseClass) snappy?

Returns truthiness of the snappy attribute

Returns:

  • (TrueClass, FalseClass)

    truthiness of the snappy attribute



23
# File 'lib/krakow/command/identify.rb', line 23

attribute :snappy, [TrueClass, FalseClass]

- ([TrueClass, FalseClass]) tls_v1

Returns the tls_v1 attribute

Returns:

  • ([TrueClass, FalseClass])

    the tls_v1 attribute



22
# File 'lib/krakow/command/identify.rb', line 22

attribute :tls_v1, [TrueClass, FalseClass]

- (TrueClass, FalseClass) tls_v1?

Returns truthiness of the tls_v1 attribute

Returns:

  • (TrueClass, FalseClass)

    truthiness of the tls_v1 attribute



22
# File 'lib/krakow/command/identify.rb', line 22

attribute :tls_v1, [TrueClass, FalseClass]

- (Object) to_line



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/krakow/command/identify.rb', line 30

def to_line
  filtered = Hash[*
    arguments.map do |key, value|
      unless(value.nil?)
        [key, value]
      end
    end.compact.flatten
  ]
  payload = MultiJson.dump(filtered)
  [name, "\n", payload.length, payload].pack('a*a*l>a*')
end