Skip to content

Instantly share code, notes, and snippets.

@megstang
Created August 19, 2020 04:01
Show Gist options
  • Select an option

  • Save megstang/258b44b1ceb30d22d1df7a0c39bb0d63 to your computer and use it in GitHub Desktop.

Select an option

Save megstang/258b44b1ceb30d22d1df7a0c39bb0d63 to your computer and use it in GitHub Desktop.

Revisions

  1. megstang created this gist Aug 19, 2020.
    43 changes: 43 additions & 0 deletions argument_scope_examples.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    #### Example 10

    ```ruby
    def print_variable(x)
    puts x
    end

    print_variable(4)
    ```

    #### Example 11

    ```ruby
    def print_variable(x)
    puts x
    end

    x = 4
    print_variable(x)
    ```

    #### Example 12

    ```ruby
    def print_variable(x)
    puts x
    end

    print_variable(2)
    puts x
    ```

    #### Example 13

    ```ruby
    def print_variable(x)
    x = 4
    puts x
    end

    print_variable(2)
    puts x
    ```