Class: Y2Network::ConnectionConfig::IPConfig

Inherits:
Object
  • Object
show all
Includes:
Y2Network::CanBeCopied
Defined in:
src/lib/y2network/connection_config/ip_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Y2Network::CanBeCopied

#copy

Constructor Details

#initialize(address, id: "", label: nil, remote_address: nil, broadcast: nil) ⇒ IPConfig

Constructor


46
47
48
49
50
51
52
# File 'src/lib/y2network/connection_config/ip_config.rb', line 46

def initialize(address, id: "", label: nil, remote_address: nil, broadcast: nil)
  @address = address
  @id = id
  @label = label
  @remote_address = remote_address
  @broadcast = broadcast
end

Instance Attribute Details

#addressIPAddress


28
29
30
# File 'src/lib/y2network/connection_config/ip_config.rb', line 28

def address
  @address
end

#broadcastIPAddress?


34
35
36
# File 'src/lib/y2network/connection_config/ip_config.rb', line 34

def broadcast
  @broadcast
end

#idString


36
37
38
# File 'src/lib/y2network/connection_config/ip_config.rb', line 36

def id
  @id
end

#labelString?


30
31
32
# File 'src/lib/y2network/connection_config/ip_config.rb', line 30

def label
  @label
end

#remote_addressIPAddress?


32
33
34
# File 'src/lib/y2network/connection_config/ip_config.rb', line 32

def remote_address
  @remote_address
end

Instance Method Details

#==(other) ⇒ Boolean

Determines whether IP configurations are equal


57
58
59
60
61
62
# File 'src/lib/y2network/connection_config/ip_config.rb', line 57

def ==(other)
  return false if other.nil?
  address == other.address && label == other.label &&
    remote_address == other.remote_address && broadcast == other.broadcast &&
    id == other.id
end