Log in Sign up
3 Matching Annotations
  1. Dec 2022
  2. stackoverflow.com stackoverflow.com
    Can I pass a block to a Proc?
    1
    1. TylerRick 14 Dec 2022
      in Public
      Procs can't accept blocks as implicit arguments (the format you're trying). A proc can receive other proc objects as arguments, either explicitly, or using & arguments. Example: a = Proc.new do |&block| block.call end a.call() {puts "hi"}
      Ruby: Proc limitations Ruby: methods limitations leading to workarounds Ruby: blocks ruby: callable object
    Visit annotations in context

    Tags

    • Ruby: blocks
    • ruby: callable object
    • limitations
    • Ruby: Proc
    • Ruby: methods
    • limitations leading to workarounds

    Annotators

    • TylerRick

    URL

    stackoverflow.com/questions/19127645/can-i-pass-a-block-to-a-proc
  3. Oct 2022
  4. stackoverflow.com stackoverflow.com
    Using yield inside define_method in Ruby
    2
    1. TylerRick 26 Oct 2022
      in Public
      Test.new.test { puts "Hi!" }
      Ruby: blocks example
    2. TylerRick 26 Oct 2022
      in Public
      Ruby syntax limitations Ruby: blocks
    Visit annotations in context

    Tags

    • Ruby: blocks
    • limitations
    • example
    • Ruby
    • syntax

    Annotators

    • TylerRick

    URL

    stackoverflow.com/questions/2306731/using-yield-inside-define-method-in-ruby
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