rd 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rklass.rb +5 -8
- metadata +1 -1
data/lib/rklass.rb
CHANGED
@@ -105,16 +105,14 @@ class RKlass
|
|
105
105
|
end
|
106
106
|
data = { :methods => methods, :includes => includes }
|
107
107
|
yield data if block_given?
|
108
|
-
data
|
109
108
|
end
|
110
109
|
|
111
|
-
def cout
|
110
|
+
def cout
|
112
111
|
if self.respond_to?(@search.to_sym)
|
113
112
|
yield Formatter.cout(self.send(@search.to_sym)) if block_given?
|
114
113
|
else
|
115
114
|
klass = @search
|
116
115
|
klass = klass.capitalize if !KLASSES.include?(klass)
|
117
|
-
# class_data = parse_class_data(load_class_data(klass))
|
118
116
|
RKlass::load_class_data(klass) do |klass_doc|
|
119
117
|
RKlass::parse_class_data(klass_doc) do |class_data|
|
120
118
|
data = {}
|
@@ -128,7 +126,7 @@ class RKlass
|
|
128
126
|
data[sub] = class_data[:methods][@method][sub]
|
129
127
|
end
|
130
128
|
end
|
131
|
-
|
129
|
+
|
132
130
|
yield Formatter.cout({ klass => data }) if block_given?
|
133
131
|
end
|
134
132
|
end
|
@@ -139,7 +137,7 @@ class RKlass
|
|
139
137
|
{ :available_classes => KLASSES }
|
140
138
|
end
|
141
139
|
|
142
|
-
def tutorial
|
140
|
+
def tutorial
|
143
141
|
klass = KLASSES[Random.new.rand(KLASSES.size)]
|
144
142
|
RKlass::load_class_data(klass) do |klass_doc|
|
145
143
|
RKlass::parse_class_data(klass_doc) do |klass_data|
|
@@ -151,10 +149,9 @@ class RKlass
|
|
151
149
|
[:interface, :description].each do |sub|
|
152
150
|
data[sub] = method_data[sub]
|
153
151
|
end
|
154
|
-
|
155
|
-
yield Formatter.cout({ 'Tutorial mode' => ['on'], klass => data }) if block_given?
|
152
|
+
return { 'Tutorial mode' => ['on'], klass => data }
|
156
153
|
else
|
157
|
-
self.tutorial
|
154
|
+
return self.tutorial
|
158
155
|
end
|
159
156
|
end
|
160
157
|
end
|