Class: Y2Network::Route
- Inherits:
-
Object
- Object
- Y2Network::Route
- Includes:
- Yast2::Equatable
- Defined in:
- src/lib/y2network/route.rb
Overview
This class represents a network route
Instance Attribute Summary collapse
-
#gateway ⇒ IPAddr?
Gateway IP address ('via' in ip route).
-
#interface ⇒ Interface?
Interface to associate the route to.
-
#options ⇒ String
Additional options.
-
#to ⇒ IPAddr, :default
Destination; :default if it is the default route.
Instance Method Summary collapse
-
#default? ⇒ Boolean
Determines whether it is the default route or not.
-
#initialize(to: :default, interface: nil, gateway: nil, options: "") ⇒ Route
constructor
A new instance of Route.
Constructor Details
#initialize(to: :default, interface: nil, gateway: nil, options: "") ⇒ Route
Returns a new instance of Route.
41 42 43 44 45 46 |
# File 'src/lib/y2network/route.rb', line 41 def initialize(to: :default, interface: nil, gateway: nil, options: "") @to = to @interface = interface @gateway = gateway @options = end |
Instance Attribute Details
#gateway ⇒ IPAddr?
Returns Gateway IP address ('via' in ip route).
31 32 33 |
# File 'src/lib/y2network/route.rb', line 31 def gateway @gateway end |
#interface ⇒ Interface?
Returns Interface to associate the route to.
29 30 31 |
# File 'src/lib/y2network/route.rb', line 29 def interface @interface end |
#options ⇒ String
Returns Additional options.
33 34 35 |
# File 'src/lib/y2network/route.rb', line 33 def @options end |
#to ⇒ IPAddr, :default
Returns Destination; :default if it is the default route.
27 28 29 |
# File 'src/lib/y2network/route.rb', line 27 def to @to end |
Instance Method Details
#default? ⇒ Boolean
Determines whether it is the default route or not
51 52 53 |
# File 'src/lib/y2network/route.rb', line 51 def default? to == :default end |