module RequestFormattable
Public Class Methods
new(hash)
click to toggle source
# File lib/dtracer/request_formatters.rb, line 3 def initialize(hash) @hash = hash generate end
Public Instance Methods
generate()
click to toggle source
# File lib/dtracer/request_formatters.rb, line 12 def generate arr = [] methods = [:begin_section, :method_section, :body_section, :cookie_section, :header_section, :url_section] methods.each do |method_name| # get content array for a request section content_array = self.send(method_name, @hash) arr.concat(content_array) if content_array end @content = arr.join(joining_string) end
to_s()
click to toggle source
# File lib/dtracer/request_formatters.rb, line 8 def to_s @content end