Skip to content

Instantly share code, notes, and snippets.

@amatsuda
Created November 1, 2016 09:32
Show Gist options
  • Select an option

  • Save amatsuda/ec83ab33872bf79f699d4b11d265f40c to your computer and use it in GitHub Desktop.

Select an option

Save amatsuda/ec83ab33872bf79f699d4b11d265f40c to your computer and use it in GitHub Desktop.

Revisions

  1. amatsuda created this gist Nov 1, 2016.
    13 changes: 13 additions & 0 deletions include_prepend_extend_nothing.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    # Question: which module would raise an error?

    module I
    include
    end

    module P
    prepend
    end

    module X
    extend
    end
    5 changes: 5 additions & 0 deletions result.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    % ruby -v include_prepend_extend_nothing.rb
    ruby 2.4.0dev (2016-11-01 trunk 56535) [x86_64-darwin15]
    include_prepend_extend_nothing.rb:10:in `extend': wrong number of arguments (given 0, expected 1+) (ArgumentError)
    from include_prepend_extend_nothing.rb:10:in `<module:X>'
    from include_prepend_extend_nothing.rb:9:in `<main>'