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!, #escape, #has_fieldset?, #hash_to_xml_attributes, included?, #javascript, #legend, #link, #mount_table, #mount_table_for_hash, #onclick, #prefix?, start!, #stylesheet, #title, title, #to_sym, to_sym

Constructor Details

#initialize(controller) ⇒ FilesNote

Returns a new instance of FilesNote.



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

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

Instance Method Details

#contentObject



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

def content
  if @files.empty?
    ""
  else
    "<ul><li>%s</li></ul>" % @files.join("</li><li>")
  end
end

#rowObject



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

def row
  :edit
end

#valid?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/rails-footnotes/notes/files_note.rb', line 21

def valid?
  prefix?
end