Class: Footnotes::Notes::FilesNote

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

Direct Known Subclasses

JavascriptsNote, StylesheetsNote

Instance Method Summary collapse

Methods inherited from AbstractNote

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

Constructor Details

#initialize(controller) ⇒ FilesNote

Returns a new instance of FilesNote.



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

def initialize(controller)
  @files = scan_text(controller.response.body)
  parse_files!
end

Instance Method Details

#contentObject



15
16
17
18
19
20
21
# File 'lib/rails-footnotes/notes/files_note.rb', line 15

def content
  if @files.empty?
    ""
  else
    "<ul><li>#{@files.join("</li><li>")}</li></ul>"
  end
end

#rowObject



11
12
13
# File 'lib/rails-footnotes/notes/files_note.rb', line 11

def row
  :edit
end

#valid?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/rails-footnotes/notes/files_note.rb', line 23

def valid?
  prefix?
end