Class: Keela::Strategies::Scopes
Instance Method Summary
collapse
#extract_definitions_from_file
Instance Method Details
#definition_file_pattern ⇒ Object
10
11
12
|
# File 'lib/keela/strategies/scopes.rb', line 10
def definition_file_pattern
%r{app/models}
end
|
14
15
16
17
18
|
# File 'lib/keela/strategies/scopes.rb', line 14
def (line)
return nil unless line =~ /\bscope\s+:(\w+)/
Regexp.last_match(1)
end
|
#name ⇒ Object
6
7
8
|
# File 'lib/keela/strategies/scopes.rb', line 6
def name
"scopes"
end
|
24
25
26
|
# File 'lib/keela/strategies/scopes.rb', line 24
def
true
end
|
#usage_regex(name) ⇒ Object
20
21
22
|
# File 'lib/keela/strategies/scopes.rb', line 20
def usage_regex(name)
/(?<!scope :)(?<!def )#{Regexp.quote(name)}\W/
end
|