File: introduce4.rb.testApplyExtractMethod4b.fixed

package info (click to toggle)
netbeans-ide 6.0.1%2Bdfsg-2
  • links: PTS, VCS
  • area: contrib
  • in suites: lenny
  • size: 741,536 kB
  • ctags: 613,961
  • sloc: java: 3,969,489; xml: 336,553; jsp: 11,861; ruby: 10,091; cpp: 4,127; sh: 3,417; ansic: 1,734; sql: 1,306; haskell: 1,019; makefile: 487; perl: 403; objc: 288; php: 120
file content (39 lines) | stat: -rw-r--r-- 702 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
def blocktest
  [4,5,6].each do |foo|
     x = 50
     y = 30
     x = x+y
  end #firstblock
  beforeblock = 50
  notusedinblock = 10
  usedinblock = 20
  [10,11,12].each do |bar|
    z = 50
    q = 60
    usedinblock, z = mymethod(beforeblock, q, z)
    puts z
  end #outerblock
  puts y # calls a method, y is not seen from the block
  puts usedinblock
  [7,8,9].each do |foo|
      notreadlater = 50
      puts readlater
  end #lastblock
end

# TODO Comment
def mymethod(beforeblock, q, z)
  [1,2,3].each do |foo|
    x = 51
    y = 30
    x = x+y
    puts y+q
    z = z+50
    puts beforeblock
    readlater = 50
    notreadlater = 60
    usedinblock = 20
  end #block
  return usedinblock, z
end