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.



196
197
198
199
200
201
# File 'lib/finagle-thrift/tracer.rb', line 196

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.



195
196
197
# File 'lib/finagle-thrift/tracer.rb', line 195

def host
  @host
end

#keyObject (readonly)

Returns the value of attribute key.



195
196
197
# File 'lib/finagle-thrift/tracer.rb', line 195

def key
  @key
end

#valueObject (readonly)

Returns the value of attribute value.



195
196
197
# File 'lib/finagle-thrift/tracer.rb', line 195

def value
  @value
end

Instance Method Details

#to_thriftObject



203
204
205
206
207
208
209
210
211
# File 'lib/finagle-thrift/tracer.rb', line 203

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