Log in Sign up
4 Matching Annotations
  1. Feb 2020
  2. blog.marc-andre.ca blog.marc-andre.ca
    method_missing, politely - # Hash
    1
    1. TylerRick 03 Feb 2020
      in Public
      ruby: method_missing ruby: respond_to_missing? good explanation
    Visit annotations in context

    Tags

    • ruby: method_missing
    • good explanation
    • ruby: respond_to_missing?

    Annotators

    • TylerRick

    URL

    blog.marc-andre.ca/2010/11/15/methodmissing-politely/
  3. stackoverflow.com stackoverflow.com
    `respond_to?` vs. `respond_to_missing?`
    3
    1. TylerRick 03 Feb 2020
      in Public
      It's a good practice to create respond_to_missing? if you are overriding method_missing. That way, the class will tell you the method you are calling exists, even though it's not explicitly declared.
      ruby: respond_to_missing? ruby: method_missing good advice best practices good explanation
    2. TylerRick 03 Feb 2020
      in Public
      ruby ruby: respond_to_missing?
    3. TylerRick 03 Feb 2020
      in Public
      Without respond_to_missing? defined, trying to get the method via method will fail:
      ruby: respond_to_missing?
    Visit annotations in context

    Tags

    • ruby
    • good advice
    • best practices
    • ruby: method_missing
    • good explanation
    • ruby: respond_to_missing?

    Annotators

    • TylerRick

    URL

    stackoverflow.com/questions/13793060/respond-to-vs-respond-to-missing
Share:
Group. Only group members will be able to view this annotation.
Only me. No one else will be able to view this annotation.
Hypothes.is
  • About
  • Blog
  • Bioscience
  • Education
  • Jobs
  • Help
  • Contact
  • Terms of Service
  • Privacy Policy