Commit 931a7223 authored by go.kikuta's avatar go.kikuta

array.rb: refactor (use onliner code if possible)

parent 11524f6f
......@@ -180,20 +180,14 @@ class Array
self.delete_at(i)
ret = key
end
if ret.nil? && block
block.call
else
ret
end
return block.call if ret.nil? && block
ret
end
# internal method to convert multi-value to single value
def __svalue
if self.size < 2
self.first
else
self
end
return self.first if self.size < 2
self
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment