Method: Geometry::Rotation.new
- Defined in:
- lib/aurora-geometry/rotation.rb
.new(angle) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/aurora-geometry/rotation.rb', line 23 def self.new(*args) = args.select {|a| a.is_a? Hash}.reduce({}, :merge) if .has_key? :angle RotationAngle.new [:angle] elsif .has_key?(:x) && [:x, :y, :z].one? {|k| .has_key? k } RotationAngle.new x:[:x] else self.allocate.tap {|rotation| rotation.send :initialize, *args } end end |