Class: ActiveRecord::DynamicMatchers::FindByBang

Inherits:
Method show all
Defined in:
activerecord/lib/active_record/dynamic_matchers.rb

Class Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Method

define, match, valid?

Class Attribute Details

.patternObject (readonly)

Returns the value of attribute pattern.



94
95
96
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 94

def pattern
  @pattern
end

Class Method Details

.finderObject



100
101
102
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 100

def finder
  "find_by!"
end

.match?(name) ⇒ Boolean

Returns:

  • (Boolean)


96
97
98
# File 'activerecord/lib/active_record/dynamic_matchers.rb', line 96

def match?(name)
  pattern.match?(name) && self
end