Class: DYI::Shape::ShapeGroup
- Inherits:
-
Base
- Object
- Element
- GraphicalElement
- Base
- DYI::Shape::ShapeGroup
- Defined in:
- lib/dyi/shape/base.rb
Overview
Constant Summary
Constants inherited from GraphicalElement
GraphicalElement::CLASS_REGEXP
Constants inherited from Element
Instance Attribute Summary collapse
- #child_elements ⇒ Object readonly
Attributes inherited from Base
#anchor_href, #anchor_target, #attributes, #clipping, #parent
Attributes inherited from GraphicalElement
Attributes inherited from Element
Class Method Summary collapse
Instance Method Summary collapse
- #height ⇒ Object
-
#initialize(options = {}) ⇒ ShapeGroup
constructor
A new instance of ShapeGroup.
- #width ⇒ Object
- #write_as(formatter, io = $>) ⇒ Object
Methods inherited from Base
#add_animation, #add_painting_animation, #add_transform_animation, #animate?, #animations, #clear_clipping, #draw_on, #has_marker?, #has_uri_reference?, #root_element?, #root_node?, #rotate, #scale, #set_clipping, #set_clipping_shapes, #set_event, #skew_x, #skew_y, #transform, #translate
Methods inherited from GraphicalElement
#add_css_class, #add_event_listener, #css_classes, #event_listeners, #event_target?, #remove_css_class, #remove_event_listener, #set_event, #to_reused_source
Methods inherited from Element
#canvas, #has_uri_reference?, #id, #id=, #include_external_file?, #inner_id
Constructor Details
#initialize(options = {}) ⇒ ShapeGroup
Returns a new instance of ShapeGroup.
838 839 840 841 |
# File 'lib/dyi/shape/base.rb', line 838 def initialize(={}) @attributes = init_attributes() @child_elements = [] end |
Instance Attribute Details
#child_elements ⇒ Object (readonly)
834 835 836 |
# File 'lib/dyi/shape/base.rb', line 834 def child_elements @child_elements end |
Class Method Details
.draw_on(canvas, options = {}) ⇒ Object
858 859 860 |
# File 'lib/dyi/shape/base.rb', line 858 def draw_on(canvas, = {}) new().draw_on(canvas) end |
Instance Method Details
#height ⇒ Object
847 848 849 |
# File 'lib/dyi/shape/base.rb', line 847 def height Length.new_or_nil(@attributes[:height]) end |
#width ⇒ Object
843 844 845 |
# File 'lib/dyi/shape/base.rb', line 843 def width Length.new_or_nil(@attributes[:width]) end |
#write_as(formatter, io = $>) ⇒ Object
851 852 853 |
# File 'lib/dyi/shape/base.rb', line 851 def write_as(formatter, io=$>) formatter.write_group(self, io, &(block_given? ? Proc.new : nil)) end |