Skip to content

Commit

Permalink
Minor fixes in Y2Network::Routing class
Browse files Browse the repository at this point in the history
- Attr readers for forwarding
- refer to instance variable @tables in routes
  • Loading branch information
mchf committed Mar 25, 2019
1 parent 352834d commit 650c66f
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/lib/y2network/routing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,22 @@ module Y2Network
class Routing
# @return [Array<RoutingTable>]
attr_reader :tables
# @return [Boolean] whether IPv4 forwarding is enabled
attr_reader :forward_ipv4
# @return [Boolean] whether IPv6 forwarding is enabled
attr_reader :forward_ipv6

def initialize(tables:)
@tables = tables
end

# Checks whether IPv4 forwarding is enabled
def forward_ipv4?
end

# Checks whether IPv6 forwarding is enabled
def forward_ipv6?
end

# Routes in the configuration
#
# Convenience method to iterate through the routes in all routing tables.
#
# @return [Array<Route>] List of routes which are defined in the configuration
def routes
tables.flat_map(&:to_a)
@tables.flat_map(&:to_a)
end
end
end

0 comments on commit 650c66f

Please sign in to comment.