Class: Looksee::Help

Inherits:
Object
  • Object
show all
Defined in:
lib/looksee/help.rb

Instance Method Summary collapse

Instance Method Details

#inspectObject



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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/looksee/help.rb', line 3

def inspect
  <<-EOS.gsub(/^ *\|/, '')
    |== Looksee Quick Reference
    |
    |  \e[1mobject.look(*specifiers)\e[0m  or  \e[1mLooksee[object, *specifiers]\e[0m
    |
    |    Print the methods of \`object\'.
    |
    |    Available specifiers:
    |
    |      :public     :private    :overridden
    |      :protected  :undefined
    |        Print methods with these visibilities.
    |
    |      :nopublic     :noprivate    :nooverridden
    |      :noprotected  :noundefined
    |        Do not print methods with these visibilities.
    |
    |      "string"
    |        Print methods containing this string.
    |
    |      /regexp/
    |        Print methods matching this regexp.
    |
    |    Styles:
    |
    |      #{Looksee.styles[:module] % 'Module'}
    |      #{Looksee.styles[:public] % 'public'}     }
    |      #{Looksee.styles[:protected] % 'protected'}  } like a traffic light!
    |      #{Looksee.styles[:private] % 'private'}    }
    |      #{Looksee.styles[:undefined] % 'undefined'}  ] like a ghost!
    |      #{Looksee.styles[:overridden] % 'overridden'} ] like a shadow!
    |
    |      Customize with Looksee.styles:
    |
    |        Looksee.styles = {
    |          :module => '**%s**',
    |          :private => '(%s)',
    |          ...
    |        }
    |
    |  \e[1mobject.look.edit(method)\e[0m
    |
    |    Jump to the source of the given method. Set your editor
    |    with Looksee.editor or the LOOKSEE_EDITOR environment
    |    variable. "%f" expands to the file name, "%l" to the line
    |    number. Example:
    |
    |    Looksee.editor = "emacs -nw +%f %l"
  EOS
end