Class: Krakow::Command::Identify
- Inherits:
-
Krakow::Command
- Object
- Krakow::Command
- Krakow::Command::Identify
- Defined in:
- lib/krakow/command/identify.rb
Overview
Update client metadata on server / negotiate features
Instance Attribute Summary
Attributes inherited from Krakow::Command
Attributes collapse
-
#deflate ⇒ [TrueClass, FalseClass]
The deflate attribute.
-
#deflate? ⇒ TrueClass, FalseClass
Truthiness of the deflate attribute.
-
#deflate_level ⇒ Integer
The deflate_level attribute.
-
#deflate_level? ⇒ TrueClass, FalseClass
Truthiness of the deflate_level attribute.
-
#feature_negotiation ⇒ [TrueClass, FalseClass]
The feature_negotiation attribute.
-
#feature_negotiation? ⇒ TrueClass, FalseClass
Truthiness of the feature_negotiation attribute.
-
#heartbeat_interval ⇒ Numeric
The heartbeat_interval attribute.
-
#heartbeat_interval? ⇒ TrueClass, FalseClass
Truthiness of the heartbeat_interval attribute.
-
#long_id ⇒ [String, Numeric]
The long_id attribute.
-
#long_id? ⇒ TrueClass, FalseClass
Truthiness of the long_id attribute.
-
#output_buffer_size ⇒ Integer
The output_buffer_size attribute.
-
#output_buffer_size? ⇒ TrueClass, FalseClass
Truthiness of the output_buffer_size attribute.
-
#output_buffer_timeout ⇒ Integer
The output_buffer_timeout attribute.
-
#output_buffer_timeout? ⇒ TrueClass, FalseClass
Truthiness of the output_buffer_timeout attribute.
-
#sample_rate ⇒ Integer
The sample_rate attribute.
-
#sample_rate? ⇒ TrueClass, FalseClass
Truthiness of the sample_rate attribute.
-
#short_id ⇒ [String, Numeric]
The short_id attribute.
-
#short_id? ⇒ TrueClass, FalseClass
Truthiness of the short_id attribute.
-
#snappy ⇒ [TrueClass, FalseClass]
The snappy attribute.
-
#snappy? ⇒ TrueClass, FalseClass
Truthiness of the snappy attribute.
-
#tls_v1 ⇒ [TrueClass, FalseClass]
The tls_v1 attribute.
-
#tls_v1? ⇒ TrueClass, FalseClass
Truthiness of the tls_v1 attribute.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Krakow::Command
#error?, #name, #ok?, response_for
Methods included from Utils::Lazy
Methods included from Utils::Logging
Class Method Details
.error ⇒ Object
47 48 49 |
# File 'lib/krakow/command/identify.rb', line 47 def error %w(E_INVALID E_BAD_BODY) end |
.ok ⇒ Object
43 44 45 |
# File 'lib/krakow/command/identify.rb', line 43 def ok %w(OK) end |
Instance Method Details
#deflate ⇒ [TrueClass, FalseClass]
Returns the deflate attribute.
24 |
# File 'lib/krakow/command/identify.rb', line 24 attribute :deflate, [TrueClass, FalseClass] |
#deflate? ⇒ TrueClass, FalseClass
Returns truthiness of the deflate attribute.
24 |
# File 'lib/krakow/command/identify.rb', line 24 attribute :deflate, [TrueClass, FalseClass] |
#deflate_level ⇒ Integer
Returns the deflate_level attribute.
25 |
# File 'lib/krakow/command/identify.rb', line 25 attribute :deflate_level, Integer |
#deflate_level? ⇒ TrueClass, FalseClass
Returns truthiness of the deflate_level attribute.
25 |
# File 'lib/krakow/command/identify.rb', line 25 attribute :deflate_level, Integer |
#feature_negotiation ⇒ [TrueClass, FalseClass]
Returns the feature_negotiation attribute.
18 |
# File 'lib/krakow/command/identify.rb', line 18 attribute :feature_negotiation, [TrueClass, FalseClass] |
#feature_negotiation? ⇒ TrueClass, FalseClass
Returns truthiness of the feature_negotiation attribute.
18 |
# File 'lib/krakow/command/identify.rb', line 18 attribute :feature_negotiation, [TrueClass, FalseClass] |
#heartbeat_interval ⇒ Numeric
Returns the heartbeat_interval attribute.
19 |
# File 'lib/krakow/command/identify.rb', line 19 attribute :heartbeat_interval, Numeric |
#heartbeat_interval? ⇒ TrueClass, FalseClass
Returns truthiness of the heartbeat_interval attribute.
19 |
# File 'lib/krakow/command/identify.rb', line 19 attribute :heartbeat_interval, Numeric |
#long_id ⇒ [String, Numeric]
Returns the long_id attribute.
17 |
# File 'lib/krakow/command/identify.rb', line 17 attribute :long_id, [String, Numeric], :required => true |
#long_id? ⇒ TrueClass, FalseClass
Returns truthiness of the long_id attribute.
17 |
# File 'lib/krakow/command/identify.rb', line 17 attribute :long_id, [String, Numeric], :required => true |
#output_buffer_size ⇒ Integer
Returns the output_buffer_size attribute.
20 |
# File 'lib/krakow/command/identify.rb', line 20 attribute :output_buffer_size, Integer |
#output_buffer_size? ⇒ TrueClass, FalseClass
Returns truthiness of the output_buffer_size attribute.
20 |
# File 'lib/krakow/command/identify.rb', line 20 attribute :output_buffer_size, Integer |
#output_buffer_timeout ⇒ Integer
Returns the output_buffer_timeout attribute.
21 |
# File 'lib/krakow/command/identify.rb', line 21 attribute :output_buffer_timeout, Integer |
#output_buffer_timeout? ⇒ TrueClass, FalseClass
Returns truthiness of the output_buffer_timeout attribute.
21 |
# File 'lib/krakow/command/identify.rb', line 21 attribute :output_buffer_timeout, Integer |
#sample_rate ⇒ Integer
Returns the sample_rate attribute.
26 |
# File 'lib/krakow/command/identify.rb', line 26 attribute :sample_rate, Integer |
#sample_rate? ⇒ TrueClass, FalseClass
Returns truthiness of the sample_rate attribute.
26 |
# File 'lib/krakow/command/identify.rb', line 26 attribute :sample_rate, Integer |
#short_id ⇒ [String, Numeric]
Returns the short_id attribute.
16 |
# File 'lib/krakow/command/identify.rb', line 16 attribute :short_id, [String, Numeric], :required => true |
#short_id? ⇒ TrueClass, FalseClass
Returns truthiness of the short_id attribute.
16 |
# File 'lib/krakow/command/identify.rb', line 16 attribute :short_id, [String, Numeric], :required => true |
#snappy ⇒ [TrueClass, FalseClass]
Returns the snappy attribute.
23 |
# File 'lib/krakow/command/identify.rb', line 23 attribute :snappy, [TrueClass, FalseClass] |
#snappy? ⇒ TrueClass, FalseClass
Returns truthiness of the snappy attribute.
23 |
# File 'lib/krakow/command/identify.rb', line 23 attribute :snappy, [TrueClass, FalseClass] |
#tls_v1 ⇒ [TrueClass, FalseClass]
Returns the tls_v1 attribute.
22 |
# File 'lib/krakow/command/identify.rb', line 22 attribute :tls_v1, [TrueClass, FalseClass] |
#tls_v1? ⇒ TrueClass, FalseClass
Returns truthiness of the tls_v1 attribute.
22 |
# File 'lib/krakow/command/identify.rb', line 22 attribute :tls_v1, [TrueClass, FalseClass] |
#to_line ⇒ Object
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.bytesize, payload].pack('a*a*l>a*') end |