# Network Services V1 API - Class Google::Cloud::NetworkServices::V1::TcpRoute::RouteRule (v2.10.1)

2.10.1 (latest) 2.10.0 2.9.0 2.8.0 2.7.0 2.6.1 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.1 1.2.0 1.1.0 1.0.1 0.2.0 0.1.0 Reference documentation and code samples for the Network Services V1 API class Google::Cloud::NetworkServices::V1::TcpRoute::RouteRule.

Specifies how to match traffic and how to route traffic when traffic is
matched.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #action

    def action() -> ::Google::Cloud::NetworkServices::V1::TcpRoute::RouteAction

**Returns**

- ([::Google::Cloud::NetworkServices::V1::TcpRoute::RouteAction](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-TcpRoute-RouteAction)) --- Required. The detailed rule defining how to route matched traffic.

### #action=

    def action=(value) -> ::Google::Cloud::NetworkServices::V1::TcpRoute::RouteAction

**Parameter**

- **value** ([::Google::Cloud::NetworkServices::V1::TcpRoute::RouteAction](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-TcpRoute-RouteAction)) --- Required. The detailed rule defining how to route matched traffic.
**Returns**

- ([::Google::Cloud::NetworkServices::V1::TcpRoute::RouteAction](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-TcpRoute-RouteAction)) --- Required. The detailed rule defining how to route matched traffic.

### #matches

    def matches() -> ::Array<::Google::Cloud::NetworkServices::V1::TcpRoute::RouteMatch>

**Returns**

- (::Array\<[::Google::Cloud::NetworkServices::V1::TcpRoute::RouteMatch](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-TcpRoute-RouteMatch)\>) --- Optional. RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation. If no routeMatch field is specified, this rule will unconditionally match traffic.

### #matches=

    def matches=(value) -> ::Array<::Google::Cloud::NetworkServices::V1::TcpRoute::RouteMatch>

**Parameter**

- **value** (::Array\<[::Google::Cloud::NetworkServices::V1::TcpRoute::RouteMatch](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-TcpRoute-RouteMatch)\>) --- Optional. RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation. If no routeMatch field is specified, this rule will unconditionally match traffic.
**Returns**

- (::Array\<[::Google::Cloud::NetworkServices::V1::TcpRoute::RouteMatch](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-TcpRoute-RouteMatch)\>) --- Optional. RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation. If no routeMatch field is specified, this rule will unconditionally match traffic.