Methods
B
F
I
M
N
Attributes
[R] attribute_names
[R] finder
[R] instantiator
Class Public methods
match(method)
# File activerecord/lib/active_record/dynamic_finder_match.rb, line 3
def self.match(method)
  df_match = self.new(method)
  df_match.finder ? df_match : nil
end
new(method)
# File activerecord/lib/active_record/dynamic_finder_match.rb, line 8
def initialize(method)
  @finder = :first
  case method.to_s
  when /^find_(all_by|last_by|by)_([_a-zA-Z]\w*)$/
    @finder = :last if $1 == 'last_by'
    @finder = :all if $1 == 'all_by'
    names = $2
  when /^find_by_([_a-zA-Z]\w*)\!$/
    @bang = true
    names = $1
  when /^find_or_(initialize|create)_by_([_a-zA-Z]\w*)$/
    @instantiator = $1 == 'initialize' ? :new : :create
    names = $2
  else
    @finder = nil
  end
  @attribute_names = names && names.split('_and_')
end
Instance Public methods
bang?()
# File activerecord/lib/active_record/dynamic_finder_match.rb, line 37
def bang?
  @bang
end
finder?()
# File activerecord/lib/active_record/dynamic_finder_match.rb, line 29
def finder?
  !@finder.nil? && @instantiator.nil?
end
instantiator?()
# File activerecord/lib/active_record/dynamic_finder_match.rb, line 33
def instantiator?
  @finder == :first && !@instantiator.nil?
end