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 =
"5.0.0"
@@before_hooks =
[]
@@after_hooks =
[]
@@enabled =
false

Class Method Summary collapse

Class Method Details

.after(&block) ⇒ Object



43
44
45
# File 'lib/rails-footnotes.rb', line 43

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

.before(&block) ⇒ Object



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

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

.enabled?(controller) ⇒ Boolean

Returns:

  • (Boolean)


47
48
49
50
51
52
53
54
55
56
57
# File 'lib/rails-footnotes.rb', line 47

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

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

Yields:

  • (_self)

Yield Parameters:

  • _self (Footnotes)

    the object that the method was called on



59
60
61
# File 'lib/rails-footnotes.rb', line 59

def self.setup
  yield self
end