Why not `module_function` is accesible inside the class scope?

The below code is running properly :

module Mod
def one
“This is one”
end
module_function :one
end

Below is throwing error :

class Mod
def one
“This is one”
end
module_function :one
end

~> -:5:in <class:Mod>': undefined methodmodule_function’ for

Mod:Class (NoMethodError)

~> from -:1:in `’

Why is such design?