Class: Y2Network::Presenters::RoutingSummary
- Inherits:
-
Object
- Object
- Y2Network::Presenters::RoutingSummary
- Includes:
- Yast::I18n
- Defined in:
- src/lib/y2network/presenters/routing_summary.rb
Overview
This class converts a routing configuration object into a string to be used in an AutoYaST summary
Instance Attribute Summary collapse
- #routing ⇒ Y2Network::Routing readonly
Instance Method Summary collapse
-
#initialize(config) ⇒ RoutingSummary
constructor
Constructor.
-
#text ⇒ String
Returns the summary of network configuration settings in text form.
Constructor Details
#initialize(config) ⇒ RoutingSummary
Constructor
37 38 39 40 |
# File 'src/lib/y2network/presenters/routing_summary.rb', line 37 def initialize(config) textdomain "network" @routing = config.routing end |
Instance Attribute Details
#routing ⇒ Y2Network::Routing (readonly)
32 33 34 |
# File 'src/lib/y2network/presenters/routing_summary.rb', line 32 def routing @routing end |
Instance Method Details
#text ⇒ String
TODO:
Implement the real summary.
Returns the summary of network configuration settings in text form
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'src/lib/y2network/presenters/routing_summary.rb', line 47 def text summary = "" return summary if routing.nil? gateways = gateways_string(routing) if gateways summary = Yast::Summary.AddListItem(summary, format(_("Gateways: %s"), gateways)) end summary = Yast::Summary.AddListItem( summary, format(_("IP Forwarding for IPv4: %s"), boolean_to_human(routing.forward_ipv4)) ) summary = Yast::Summary.AddListItem( summary, format(_("IP Forwarding for IPv6: %s"), boolean_to_human(routing.forward_ipv6)) ) "<ul>#{summary}</ul>" end |