Module: Rack::WebProfiler::Collector::View::Helpers

Included in:
Context
Defined in:
lib/rack/web_profiler/collector.rb

Overview

Helpers

Instance Method Summary collapse

Instance Method Details

#data(k, default = nil) ⇒ Object



211
212
213
214
215
216
217
218
# File 'lib/rack/web_profiler/collector.rb', line 211

def data(k, default = nil)
  return nil if @collection.nil?

  datas = @collection.datas[@collector.identifier.to_sym][:datas]
  return datas[k] if datas.has_key?(k)

  default
end

#panel_contentObject



202
203
204
205
206
207
208
# File 'lib/rack/web_profiler/collector.rb', line 202

def panel_content
  if block_given?
    @panel_content ||= capture(&Proc.new)
  elsif !@panel_content.nil?
    @panel_content
  end
end

#tab_contentObject



193
194
195
196
197
198
199
# File 'lib/rack/web_profiler/collector.rb', line 193

def tab_content
  if block_given?
    @tab_content ||= capture(&Proc.new)
  elsif !@tab_content.nil?
    @tab_content
  end
end