File: super

package info (click to toggle)
libdb-ruby 0.6.5-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,596 kB
  • ctags: 3,978
  • sloc: ansic: 13,984; cpp: 8,739; ruby: 7,864; sh: 47; makefile: 6
file content (28 lines) | stat: -rw-r--r-- 727 bytes parent folder | download | duplicates (18)
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
<entry index='s'>
<name>super</name>
<reference>variable</reference>
<reference>overridde</reference>
<reference>method</reference>
<content>
    Technique to call upper level ((method|Method))
    from ((overridden|Override)) method.
    When argument is omitted, super'ed slave can be called by
    the same argument as that of the master's method.

    : Question:
      If you change the value of ((variable|Variable)) given as an argument,
      which 'super' gets, the original value, or the changed?

        def foo(a)
           print a 
        end
        def self.foo(a)
           a=25
           super
        end
        foo(5)        # 5 or 25?

    : Answer
      the original one(((%5%)))
</content>
</entry>