Module: Footnotes

Defined in:
lib/rails-footnotes.rb,
lib/rails-footnotes/filter.rb,
lib/rails-footnotes/version.rb,
lib/rails-footnotes/extension.rb,
lib/rails-footnotes/abstract_note.rb,
lib/rails-footnotes/notes/env_note.rb,
lib/rails-footnotes/notes/log_note.rb,
lib/rails-footnotes/notes/view_note.rb,
lib/rails-footnotes/each_with_rescue.rb,
lib/rails-footnotes/notes/files_note.rb,
lib/rails-footnotes/notes/layout_note.rb,
lib/rails-footnotes/notes/params_note.rb,
lib/rails-footnotes/notes/routes_note.rb,
lib/rails-footnotes/notes/assigns_note.rb,
lib/rails-footnotes/notes/cookies_note.rb,
lib/rails-footnotes/notes/filters_note.rb,
lib/rails-footnotes/notes/queries_note.rb,
lib/rails-footnotes/notes/session_note.rb,
lib/rails-footnotes/notes/partials_note.rb,
lib/rails-footnotes/notes/controller_note.rb,
lib/rails-footnotes/notes/javascripts_note.rb,
lib/rails-footnotes/notes/stylesheets_note.rb,
lib/rails-footnotes/notes/log_note/note_logger.rb

Defined Under Namespace

Modules: EachWithRescue, Extensions, Notes, RailsFootnotesExtension Classes: Filter

Constant Summary collapse

VERSION =
"4.1.8"
@@before_hooks =
[]
@@after_hooks =
[]
@@enabled =
false

Class Method Summary collapse

Class Method Details

.after(&block) ⇒ Object


49
50
51
# File 'lib/rails-footnotes.rb', line 49

def self.after(&block)
  @@after_hooks << block
end

.before(&block) ⇒ Object


45
46
47
# File 'lib/rails-footnotes.rb', line 45

def self.before(&block)
  @@before_hooks << block
end

.enabled?(controller) ⇒ Boolean

Returns:

  • (Boolean)

53
54
55
56
57
58
59
60
61
62
63
# File 'lib/rails-footnotes.rb', line 53

def self.enabled?(controller)
  if @@enabled.is_a? Proc
    if @@enabled.arity == 1
      @@enabled.call(controller)
    else
      @@enabled.call
    end
  else
    !!@@enabled
  end
end

.run!Object


40
41
42
43
# File 'lib/rails-footnotes.rb', line 40

def self.run!
  ActiveSupport::Deprecation.warn "run! is deprecated and will be removed from future releases, use Footnotes.setup or Footnotes.enabled instead.", caller
  Footnotes.enabled = true
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Footnotes)

    the object that the method was called on


65
66
67
# File 'lib/rails-footnotes.rb', line 65

def self.setup
  yield self
end