Class: Class

Inherits:
Object show all
Defined in:
lib/opal.rb

Instance Method Summary collapse

Instance Method Details

#aboutObject



64
65
66
67
68
69
70
71
72
73
74
# File 'lib/opal.rb', line 64

def about
	if defined?(Colored)
		sc = ""
		sc = " < " + self.superclass.name.cyan.bold if self.superclass
		return "-- " + self.name.cyan.bold + sc + " methods".magenta.bold + " --\n" + (self.methods(self == Object) - self.instance_methods(false)).join("\n").yellow.bold.underline + "\n" +  (self.private_methods(self == Object) - self.private_instance_methods(self == Object)).join("\n").red.bold.underline + "\n-- " + self.name.cyan.bold + " < " + sc + " instance methods".magenta.bold + " --\n" + self.instance_methods(self == Object).join("\n").green.bold.underline + "\n" +  (self.private_instance_methods(self == Object)).join("\n").red.bold.underline + "\n-- " + self.name.cyan.bold + sc + " namespaces".magenta.bold + " --\n" + (self.constants).join("\n").blue.bold.underline
	else
		sc = ""
		sc = " < " + self.superclass.name if self.superclass
		return "-- #{self.name + sc} methods --\n" + (self.methods(self == Object) - self.instance_methods(self == Object)).join("\n") + "\n" +  (self.private_methods(self == Object) - self.private_instance_methods(self == Object)).join("\n") + "\n-- #{self.name + sc} instance methods --\n" + self.instance_methods(self == Object).join("\n") + "\n" +  (self.private_instance_methods(self == Object)).join("\n") + "\n-- #{self.name + sc} namespaces --\n" + (self.constants).join("\n")
	end
end

#htdoc(lsuper = false) ⇒ Object



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/opal.rb', line 75

def htdoc(lsuper=false)
	a1 = "" ; a2 = ""
	a1 = "<a href=\"#{self.superclass.name + ".doc.htm" rescue ""}\" style=\"color: cyan;\">" if lsuper
	a2 = "</a>" if lsuper
	sc = ""
	sc = " < <strong style=\"color: cyan;\">" + a1 + self.superclass.name + a2 + "</strong>" if self.superclass
	return <<EOF
<div style="background-color: black; color: white; font-family: Courier New; padding: 7px;">
-- <strong style="color: cyan;">#{self.name}</strong>#{sc} <strong style="color: magenta;">methods</strong> --
<div style="color: yellow; text-decoration: underline;">
#{(self.methods(self == Object) - self.instance_methods(self == Object)).join("<br/>\n")}
</div>
<div style="color: red; text-decoration: underline;">
#{(self.private_methods(self == Object) - self.private_instance_methods(self == Object)).join(" private!<br/>\n")}
</div>
-- <strong style="color: cyan;">#{self.name}</strong>#{sc} <strong style="color: magenta;">instance methods</strong> --
<div style="color: lime; text-decoration: underline;">
#{(self.instance_methods(self == Object)).join("<br/>\n")}
</div>
<div style="color: red; text-decoration: underline;">
#{(self.private_instance_methods(self == Object)).join(" private!<br/>\n")}
</div>
-- <strong style="color: cyan;">#{self.name}</strong>#{sc} <strong style="color: magenta;">namespaces</strong> --
<div style="color: lightblue; text-decoration: underline;">
#{(self.constants).join("<br/>\n")}
</div>
</div>
EOF
end