###### RMagick 1.15.10 User's Guide and Reference

# class RVG::Group < Object

## class methods

### new

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

#### 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.

#### See also

RVG

## attributes

### desc, desc=

group.desc -> aString
group.desc = aString

#### Description

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

### metadata, metadata=

group.metadata -> aString
group.metadata = aString

#### Description

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

### title, title=

group.title -> aString
group.title = aString

#### Description

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

## instance methods

### g

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

#### 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) -> anImage

#### 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| ...}] -> anRVG

#### 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) [{|aText| ...}] -> aText

#### 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) -> aUse

#### 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.