class RVG::Group < Object

Table of Contents

class methods

attributes

instance methods

shared methods

In addition to the methods listed above, class RVG::Group also implements the styles method, the shape methods and the transform methods.

class methods

new

RVG::Group.new [ { |self| drawing method calls } ] -> group

Description

Drawing objects defined within a group share the transforms and styles defined on the group. Groups can be nested arbitrarily deep. RVG::Group.new is commonly invoked within another group or RVG object by calling the g method (RVG#g, RVG::Group#g) , which nests the group within the target object.

RVG::Group.new yields to a block if one is present, passing self as an argument.

Returns

An RVG::Group object

Example

See the tutorial for examples of the most common uses of groups. In this example, I use RVG::Group.new to construct a "stand-alone" group that is then referenced in multiple calls to the use method.

group example

See also

RVG

attributes

desc, desc=

group.desc -> string
group.desc = string

Description

Use the desc attribute to assign a text description to the group.

metadata, metadata=

group.metadata -> string
group.metadata = string

Description

Use the metadata attribute to assign additional metadata to the group.

title, title=

group.title -> string
group.title = string

Description

Use the title attribute to assign a title to the group.

instance methods

g

group.g [{|grp| ...}] -> group

Description

Calls new to construct a new group and nests it within the target group. Yields to a block if one is present, passing the new group as an argument.

Returns

Returns the new group, so other methods in this class can be chained to this method.

image

group.image(raster_image, width=nil, height=nil, x=0, y=0) -> image

Description

Calls RVG::Image.new to construct an image and adds it to the group.

Returns

Returns the new image, so RVG::Image methods can be chained to this method.

rvg

group.rvg(width, height, x=0, y=0) [{|new_rvg| ...}] -> rvg

Description

Calls RVG.new to construct a new RVG object and adds it to the group. See the rvg method in the RVG class.

Returns

The RVG object, so other RVG methods can be chained to this method.

text

group.text(x=0, y=0, text=nil) [{|text| ...}] -> text

Description

Calls RVG::Text.new to construct a text object and adds it to the group. Yields to a block if one is present, passing the new text object as an argument.

Returns

The RVG::Text object, so other RVG::Text methods can be chained to this method.

use

group.use(obj, x=0, y=0, width=nil, height=nil) -> use

Description

Calls RVG::Use.new to constructs a use object and adds it to the RVG object.

When the referenced argument is an RVG object, width and height can be used to specify the width and height of the viewport. If present and non-nil, these arguments override any width and height specified when the RVG object was created. You must specify the viewport size either when creating the RVG object or when referencing it with use.

Example

See RVG::Use.new

Returns

The RVG::Use object, so other RVG::Use methods can be chained to this method.