Class: Mobj::Circle
Class Method Summary collapse
Class Method Details
.wrap!(wrapped) ⇒ Object
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/mobj.rb', line 140 def self.wrap!(wrapped) return wrapped if wrapped.a?(CircleHash) || wrapped.a?(CircleRay) if wrapped.a? circle = CircleRay.new wrapped.each_with_index { |item, i| circle[i] = wrap!(item) } circle elsif wrapped.h? circle = CircleHash.new wrapped.each_pair { |key, val| circle[key] = wrap!(val) } circle else wrapped end end |