MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / is_ruby_hook_call

Function is_ruby_hook_call

codegraph-kernel/src/ruby.rs:43–48  ·  view source on GitHub ↗

isRubyHookCall (function-ref.ts:282-286).

(name: &str)

Source from the content-addressed store, hash-verified

41
42/// isRubyHookCall (function-ref.ts:282-286).
43fn is_ruby_hook_call(name: &str) -> bool {
44 static RE: OnceLock<Regex> = OnceLock::new();
45 let re = RE.get_or_init(|| Regex::new(r"^(skip_)?(before|after|around)_[a-z_]+$").unwrap());
46 re.is_match(name)
47 || matches!(name, "validate" | "set_callback" | "helper_method" | "rescue_from")
48}
49
50/// The hook-DSL symbol shape (`/^[A-Za-z_][A-Za-z0-9_?!]*$/`).
51fn ruby_sym_re() -> &'static Regex {

Callers 1

Calls 1

unwrapMethod · 0.60

Tested by

no test coverage detected