Sha256: 39213643f2920b4a23156bd863272ce11eeb25d6e462fc994719b916fe5c9e99

Contents?: true

Size: 565 Bytes

Versions: 7

Compression:

Stored size: 565 Bytes

Contents

require "#{File.dirname(__FILE__)}/abstract_note"

module Footnotes
  module Notes
    class ViewNote < AbstractNote
      def initialize(controller)
        @controller = controller
        @template = controller.instance_variable_get(:@template)
      end

      def row
        :edit
      end

      def link
        escape(Footnotes::Filter.prefix(filename, 1, 1))
      end

      def valid?
        prefix? && @template && @template.template
      end

      protected
        def filename
          @template.template.filename
        end
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
ceritium-rails-footnotes-3.4.1.1 lib/rails-footnotes/notes/view_note.rb
ceritium-rails-footnotes-3.4.1 lib/rails-footnotes/notes/view_note.rb
ceritium-rails-footnotes-3.4 lib/rails-footnotes/notes/view_note.rb
josevalim-rails-footnotes-3.4.1 lib/rails-footnotes/notes/view_note.rb
josevalim-rails-footnotes-3.4 lib/rails-footnotes/notes/view_note.rb
lexrupy-rails-footnotes-3.4.1 lib/rails-footnotes/notes/view_note.rb
lexrupy-rails-footnotes-3.4 lib/rails-footnotes/notes/view_note.rb