Class: Y2Network::RoutingTable
- Inherits:
-
Object
- Object
- Y2Network::RoutingTable
- Extended by:
- Forwardable
- Includes:
- Enumerable, Yast2::Equatable
- Defined in:
- src/lib/y2network/routing_table.rb
Overview
Represents a routing table
Instance Attribute Summary collapse
-
#routes ⇒ Array<Route>
readonly
Routes included in the table.
Instance Method Summary collapse
-
#initialize(routes = []) ⇒ RoutingTable
constructor
A new instance of RoutingTable.
-
#remove_default_routes ⇒ Object
Returns the default route.
Constructor Details
#initialize(routes = []) ⇒ RoutingTable
Returns a new instance of RoutingTable.
45 46 47 |
# File 'src/lib/y2network/routing_table.rb', line 45 def initialize(routes = []) @routes = routes end |
Instance Attribute Details
#routes ⇒ Array<Route> (readonly)
Returns Routes included in the table.
39 40 41 |
# File 'src/lib/y2network/routing_table.rb', line 39 def routes @routes end |
Instance Method Details
#remove_default_routes ⇒ Object
Returns the default route
50 51 52 |
# File 'src/lib/y2network/routing_table.rb', line 50 def remove_default_routes @routes.reject!(&:default?) end |