Class: Footnotes::Notes::AssignsNote

Inherits:
AbstractNote show all
Defined in:
lib/sinatra-footnotes/notes/assigns_note.rb

Constant Summary collapse

@@ignored_assigns =
[
  :@real_format,
  :@before_filter_chain_aborted,
  :@performed_redirect,
  :@performed_render,
  :@_params,
  :@_response,
  :@url,
  :@template,
  :@_request,
  :@db_rt_before_render,
  :@db_rt_after_render,
  :@view_runtime
]

Instance Method Summary collapse

Methods inherited from AbstractNote

close!, #has_fieldset?, included?, #javascript, #legend, #link, #onclick, #row, start!, #stylesheet, title, #to_sym, to_sym

Constructor Details

#initialize(controller) ⇒ AssignsNote

Returns a new instance of AssignsNote.



22
23
24
# File 'lib/sinatra-footnotes/notes/assigns_note.rb', line 22

def initialize(controller)
  @controller = controller
end

Instance Method Details

#contentObject



34
35
36
37
38
39
40
# File 'lib/sinatra-footnotes/notes/assigns_note.rb', line 34

def content
  rows = []
  assigns.each do |key|
    rows << [ key, escape(assigned_value(key)) ]
  end
  mount_table(rows.unshift(['Name', 'Value']), :class => 'name_values', :summary => "Debug information for #{title}")
end

#titleObject



26
27
28
# File 'lib/sinatra-footnotes/notes/assigns_note.rb', line 26

def title
  "Assigns (#{assigns.size})"
end

#valid?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/sinatra-footnotes/notes/assigns_note.rb', line 30

def valid?
  assigns
end