Class: Robe::Scanner
- Inherits:
-
Object
- Object
- Robe::Scanner
- Defined in:
- lib/robe/scanners.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#candidates ⇒ Object
readonly
Returns the value of attribute candidates.
-
#check_private ⇒ Object
Returns the value of attribute check_private.
Instance Method Summary collapse
-
#initialize(sym, check_private) ⇒ Scanner
constructor
A new instance of Scanner.
- #scan(modules, check_instance, check_module) ⇒ Object
Constructor Details
#initialize(sym, check_private) ⇒ Scanner
Returns a new instance of Scanner.
8 9 10 11 12 |
# File 'lib/robe/scanners.rb', line 8 def initialize(sym, check_private) @candidates = [] @sym = sym @check_private = check_private end |
Instance Attribute Details
#candidates ⇒ Object (readonly)
Returns the value of attribute candidates.
6 7 8 |
# File 'lib/robe/scanners.rb', line 6 def candidates @candidates end |
#check_private ⇒ Object
Returns the value of attribute check_private.
5 6 7 |
# File 'lib/robe/scanners.rb', line 5 def check_private @check_private end |
Instance Method Details
#scan(modules, check_instance, check_module) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/robe/scanners.rb', line 14 def scan(modules, check_instance, check_module) modules.each do |m| if check_module sc = m.__singleton_class__ scan_methods(sc, :__instance_methods__) scan_methods(sc, :__private_instance_methods__) if check_private end if check_instance scan_methods(m, :__instance_methods__) scan_methods(m, :__private_instance_methods__) if check_private end end end |