Class: Footnotes::Notes::FlashNote

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

Instance Method Summary collapse

Methods inherited from AbstractNote

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

Constructor Details

#initialize(controller) ⇒ FlashNote

Returns a new instance of FlashNote.



6
7
8
9
10
11
12
13
# File 'lib/sinatra-footnotes/notes/flash_note.rb', line 6

def initialize(controller)
  @flash = {}
  if controller.respond_to? :flash
    controller.flash.keys.each do |key|
      @flash[key] = controller.flash[key]
    end
  end
end

Instance Method Details

#contentObject



19
20
21
# File 'lib/sinatra-footnotes/notes/flash_note.rb', line 19

def content
  mount_table_for_hash(@flash, :summary => "Debug information for #{title}")
end

#titleObject



15
16
17
# File 'lib/sinatra-footnotes/notes/flash_note.rb', line 15

def title
  "Flash (#{@flash.length})"
end