Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikibooksThe Free Textbook Project
Search

Ruby Programming/Syntax/Hooks

From Wikibooks, open books for an open world
<Ruby Programming |Syntax
This page may need to bereviewed for quality.

Ruby provides callbacks, to, for example, know when a new method is defined (later) in a class.

Here is a list of known callbacks.

const_missing

[edit |edit source]
class Object  def self.const_missing c    p 'missing const was', c  endend

or more

class Object  class << self    alias :const_missing_old :const_missing    def const_missing c      p 'const missing is', c      const_missing_old c    end  endend
Retrieved from "https://en.wikibooks.org/w/index.php?title=Ruby_Programming/Syntax/Hooks&oldid=1940482"
Category:

[8]ページ先頭

©2009-2025 Movatter.jp