Skip to content

Commit

Permalink
Add Y2Network::Config#id
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs authored and mchf committed Mar 21, 2019
1 parent e25549d commit 803d7b0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/lib/y2network/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ module Y2Network
# config = Y2Network::Config.from(:sysconfig)
# config.interfaces.map(&:name) #=> ["lo", eth0", "wlan0"]
class Config
# @return [Symbol] Configuration ID
attr_reader :id
# @return [Array<Interface>]
attr_reader :interfaces
# @return [Array<RoutingTable>]
Expand All @@ -39,8 +41,13 @@ def from(source)
end
end

# @param devices [Array<Device>]
def initialize(interfaces:, routing_tables:)
# Constructor
#
# @param id [Symbol] Configuration ID
# @param interfaces [Array<Interface>] List of interfaces
# @param routing_tables [Array<RoutingTable>] List of routing tables
def initialize(id: :system, interfaces:, routing_tables:)
@id = id
@interfaces = interfaces
@routing_tables = routing_tables
end
Expand Down

0 comments on commit 803d7b0

Please sign in to comment.