Class: Y2Network::Route

Inherits:
Object
  • Object
show all
Defined in:
src/lib/y2network/route.rb

Overview

This class represents a network route

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(to: :default, interface: nil, gateway: nil, options: "") ⇒ Route


35
36
37
38
39
40
# File 'src/lib/y2network/route.rb', line 35

def initialize(to: :default, interface: nil, gateway: nil, options: "")
  @to = to
  @interface = interface
  @gateway = gateway
  @options = options
end

Instance Attribute Details

#gatewayIPAddr?


27
28
29
# File 'src/lib/y2network/route.rb', line 27

def gateway
  @gateway
end

#interfaceInterface?


25
26
27
# File 'src/lib/y2network/route.rb', line 25

def interface
  @interface
end

#optionsString


29
30
31
# File 'src/lib/y2network/route.rb', line 29

def options
  @options
end

#toIPAddr, :default


23
24
25
# File 'src/lib/y2network/route.rb', line 23

def to
  @to
end

Instance Method Details

#==(other) ⇒ Boolean Also known as: eql?

Determines whether two routes are equal


53
54
55
56
# File 'src/lib/y2network/route.rb', line 53

def ==(other)
  to == other.to && interface == other.interface && gateway == other.gateway &&
    options == other.options
end

#default?Boolean

Determines whether it is the default route or not


45
46
47
# File 'src/lib/y2network/route.rb', line 45

def default?
  to == :default
end