Class: NewRelic::Agent::NewRelicService::Marshaller
- Inherits:
-
Object
- Object
- NewRelic::Agent::NewRelicService::Marshaller
show all
- Defined in:
- lib/new_relic/agent/new_relic_service.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.human_readable? ⇒ Boolean
421
422
423
|
# File 'lib/new_relic/agent/new_relic_service.rb', line 421
def self.human_readable?
false
end
|
Instance Method Details
#default_encoder ⇒ Object
417
418
419
|
# File 'lib/new_relic/agent/new_relic_service.rb', line 417
def default_encoder
Encoders::Identity
end
|
#parsed_error(error) ⇒ Object
398
399
400
401
402
403
404
|
# File 'lib/new_relic/agent/new_relic_service.rb', line 398
def parsed_error(error)
error_class = error['error_type'].split('::') \
.inject(Module) {|mod,const| mod.const_get(const) }
error_class.new(error['message'])
rescue NameError
CollectorError.new("#{error['error_type']}: #{error['message']}")
end
|
#prepare(data, options = {}) ⇒ Object
406
407
408
409
410
411
412
413
414
415
|
# File 'lib/new_relic/agent/new_relic_service.rb', line 406
def prepare(data, options={})
encoder = options[:encoder] || default_encoder
if data.respond_to?(:to_collector_array)
data.to_collector_array(encoder)
elsif data.kind_of?(Array)
data.map { |element| prepare(element, options) }
else
data
end
end
|