Class: Footnotes::Notes::AssignsNote

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

Constant Summary collapse

@@ignored_assigns =
%w( @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.



9
10
11
# File 'lib/rails-footnotes/notes/assigns_note.rb', line 9

def initialize(controller)
  @controller = controller
end

Instance Method Details

#contentObject



21
22
23
24
25
26
27
# File 'lib/rails-footnotes/notes/assigns_note.rb', line 21

def content
  rows = []
  assigns.each do |key|
    rows << [ key, assigned_value(key) ]
  end
  mount_table(rows.unshift(['Name', 'Value']), :class => 'name_values')
end

#titleObject



13
14
15
# File 'lib/rails-footnotes/notes/assigns_note.rb', line 13

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

#valid?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/rails-footnotes/notes/assigns_note.rb', line 17

def valid?
  assigns
end