Class: SolidRuby::Transformations::Mirror
- Inherits:
-
Transformation
- Object
- Transformation
- SolidRuby::Transformations::Mirror
- Defined in:
- lib/solidruby/transformations/mirror.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
-
#z ⇒ Object
Returns the value of attribute z.
Attributes inherited from Transformation
Instance Method Summary collapse
-
#initialize(*args) ⇒ Mirror
constructor
A new instance of Mirror.
- #to_rubyscad ⇒ Object
Methods inherited from Transformation
Constructor Details
#initialize(*args) ⇒ Mirror
Returns a new instance of Mirror.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/solidruby/transformations/mirror.rb', line 20 def initialize(*args) if args.first.is_a? Hash args = args.first @x = args[:x] @y = args[:y] @z = args[:z] else args = [args].flatten @x = args.include?(:x) ? 1 : nil @y = args.include?(:y) ? 1 : nil @z = args.include?(:z) ? 1 : nil args = {x: @x, y: @y, z: @z} end super(args) end |
Instance Attribute Details
#x ⇒ Object
Returns the value of attribute x.
18 19 20 |
# File 'lib/solidruby/transformations/mirror.rb', line 18 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
18 19 20 |
# File 'lib/solidruby/transformations/mirror.rb', line 18 def y @y end |
#z ⇒ Object
Returns the value of attribute z.
18 19 20 |
# File 'lib/solidruby/transformations/mirror.rb', line 18 def z @z end |
Instance Method Details
#to_rubyscad ⇒ Object
38 39 40 |
# File 'lib/solidruby/transformations/mirror.rb', line 38 def to_rubyscad RubyScadBridge.new.mirror(@args) end |