Class: Trace::BinaryAnnotation

Inherits:
Object
  • Object
show all
Defined in:
lib/finagle-thrift/tracer.rb

Defined Under Namespace

Modules: Type

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, value, annotation_type, host) ⇒ BinaryAnnotation

Returns a new instance of BinaryAnnotation.



190
191
192
193
194
195
# File 'lib/finagle-thrift/tracer.rb', line 190

def initialize(key, value, annotation_type, host)
  @key = key
  @value = value
  @annotation_type = annotation_type
  @host = host
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



189
190
191
# File 'lib/finagle-thrift/tracer.rb', line 189

def host
  @host
end

#keyObject (readonly)

Returns the value of attribute key.



189
190
191
# File 'lib/finagle-thrift/tracer.rb', line 189

def key
  @key
end

#valueObject (readonly)

Returns the value of attribute value.



189
190
191
# File 'lib/finagle-thrift/tracer.rb', line 189

def value
  @value
end

Instance Method Details

#to_thriftObject



197
198
199
200
201
202
203
204
205
# File 'lib/finagle-thrift/tracer.rb', line 197

def to_thrift
  thrift_host = host ? host.to_thrift : nil
  FinagleThrift::BinaryAnnotation.new(
    :key => @key,
    :value => @value,
    :annotation_type => Type.to_thrift(@annotation_type),
    :host => thrift_host
  )
end