Class: MwrapRack::EachAt

Inherits:
Struct
  • Object
show all
Includes:
HtmlResponse
Defined in:
lib/mwrap_rack.rb

Overview

:nodoc:

Constant Summary collapse

HEADER =
'<tr><th>size</th><th>generation</th></tr>'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HtmlResponse

#response

Instance Attribute Details

#locObject

Returns the value of attribute loc

Returns:

  • (Object)

    the current value of loc



76
77
78
# File 'lib/mwrap_rack.rb', line 76

def loc
  @loc
end

Instance Method Details

#each {|-"<html><head><title>#{t}</title></head>" \ "<body><h1>live allocations at #{t}</h1>" \ "<h2>Current generation: #{GC.count}</h2>\n<table>#{HEADER}")| ... } ⇒ Object

Yields:

  • (-"<html><head><title>#{t}</title></head>" \ "<body><h1>live allocations at #{t}</h1>" \ "<h2>Current generation: #{GC.count}</h2>\n<table>#{HEADER}"))


80
81
82
83
84
85
86
87
88
89
# File 'lib/mwrap_rack.rb', line 80

def each
  t = loc.name.encode(xml: :text)
  yield(-"<html><head><title>#{t}</title></head>" \
         "<body><h1>live allocations at #{t}</h1>" \
         "<h2>Current generation: #{GC.count}</h2>\n<table>#{HEADER}")
  loc.each do |size, generation|
    yield("<tr><td>#{size}</td><td>#{generation}</td></tr>\n")
  end
  yield "</table></body></html>\n"
end