File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,8 @@ def my_none?(para = nil)
66
66
to_a . my_each { |val | return false if val . is_a? ( para ) }
67
67
elsif para
68
68
to_a . my_each { |val | return false if val == para }
69
- else to_a . my_each { |val | return false if yield ( val ) }
69
+ else
70
+ to_a . my_each { |val | return false if yield ( val ) }
70
71
end
71
72
true
72
73
end
@@ -88,7 +89,8 @@ def my_map(my_proc = nil)
88
89
arr = [ ]
89
90
if my_proc
90
91
to_a . my_each { |val | arr << my_proc . call ( val ) }
91
- else to_a . my_each { |val | arr << yield ( val ) }
92
+ else
93
+ to_a . my_each { |val | arr << yield ( val ) }
92
94
end
93
95
arr
94
96
end
@@ -108,7 +110,8 @@ def my_inject(initial_1 = nil, initial_2 = nil)
108
110
1 . upto ( to_a . length - 1 ) { |i | memo = yield ( memo , to_a [ i ] ) }
109
111
elsif !block_given? && !initial_1
110
112
raise LocalJumpError
111
- else return 'input error'
113
+ else
114
+ return 'input error'
112
115
end
113
116
memo
114
117
end
You can’t perform that action at this time.
0 commit comments