class Fragmentary::Template

Just a wrapper to allow us to call a configurable current_user_method on the template

Public Class Methods

new(template) click to toggle source
# File lib/fragmentary/fragments_helper.rb, line 61
def initialize(template)
  @template = template
end

Public Instance Methods

current_user() click to toggle source
# File lib/fragmentary/fragments_helper.rb, line 65
def current_user
  return nil unless methd = Fragmentary.current_user_method
  if @template.respond_to? methd
    @template.send methd
  else
    raise NoMethodError, "The current_user_method '#{methd.to_s}' specified doesn't exist"
  end
end