Class: Footnotes::Notes::CookiesNote

Inherits:
AbstractNote show all
Defined in:
lib/rails-footnotes/notes/cookies_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) ⇒ CookiesNote

Returns a new instance of CookiesNote.



6
7
8
# File 'lib/rails-footnotes/notes/cookies_note.rb', line 6

def initialize(controller)
  @cookies = (controller.__send__(:cookies) || {}).symbolize_keys
end

Instance Method Details

#contentObject



14
15
16
# File 'lib/rails-footnotes/notes/cookies_note.rb', line 14

def content
  escape(@cookies.inspect)
end

#titleObject



10
11
12
# File 'lib/rails-footnotes/notes/cookies_note.rb', line 10

def title
  "Cookies (#{@cookies.length})"
end