Class: Sketch::Group
Direct Known Subclasses
Constant Summary
Constants inherited from Sketch
Arc, Circle, Line, Path, Polygon, Polyline, Rectangle, Square
Instance Attribute Summary collapse
-
#transformation ⇒ Object
readonly
Returns the value of attribute transformation.
Attributes inherited from Sketch
#bounds, #elements, #first, #geometry, #last, #max, #min, #minmax, #size
Instance Method Summary collapse
-
#initialize(*args, &block) ⇒ Group
constructor
A new instance of Group.
- #rotation ⇒ Object
- #scale ⇒ Object
- #translation ⇒ Object
Methods inherited from Sketch
#add_arc, #add_circle, #add_line, #add_point, #add_rectangle, #add_square, #add_triangle, #define_parameter, define_parameter, #push
Constructor Details
#initialize(*args, &block) ⇒ Group
Returns a new instance of Group.
17 18 19 20 21 22 23 24 |
# File 'lib/sketch/group.rb', line 17 def initialize(*args, &block) super &block , args = args.partition {|a| a.is_a? Hash} = .reduce({}, :merge) @transformation = .delete(:transformation) || Geometry::Transformation.new() end |
Instance Attribute Details
#transformation ⇒ Object (readonly)
Returns the value of attribute transformation.
15 16 17 |
# File 'lib/sketch/group.rb', line 15 def transformation @transformation end |
Instance Method Details
#rotation ⇒ Object
26 27 28 |
# File 'lib/sketch/group.rb', line 26 def rotation @transformation.rotation end |
#scale ⇒ Object
30 31 32 |
# File 'lib/sketch/group.rb', line 30 def scale @transformation.scale end |
#translation ⇒ Object
34 35 36 |
# File 'lib/sketch/group.rb', line 34 def translation @transformation.translation end |