Class: Morpheus::Client::CachedRequestFormatter

Inherits:
RequestFormatter show all
Defined in:
lib/morpheus/client/cached_request_formatter.rb

Constant Summary

Constants inherited from RequestFormatter

RequestFormatter::CYAN, RequestFormatter::GREEN, RequestFormatter::MAGENTA, RequestFormatter::RED, RequestFormatter::YELLOW

Instance Attribute Summary

Attributes inherited from RequestFormatter

#event, #subscriber

Instance Method Summary collapse

Methods inherited from RequestFormatter

call, #color, #formatted_payload, #initialize, #odd?, #payload, #request_color

Constructor Details

This class inherits a constructor from Morpheus::Client::RequestFormatter

Instance Method Details

#callObject



5
6
7
# File 'lib/morpheus/client/cached_request_formatter.rb', line 5

def call
  "#{request_statement} #{payload}"
end

#durationObject



14
15
16
# File 'lib/morpheus/client/cached_request_formatter.rb', line 14

def duration
  event.duration
end

#request_statementObject



9
10
11
12
# File 'lib/morpheus/client/cached_request_formatter.rb', line 9

def request_statement
  statement = "CACHE (#{duration}ms)"
  color(statement, request_color, true)
end