Class: Y2Network::AutoinstProfile::RouteSection
- Inherits:
-
Installation::AutoinstProfile::SectionWithAttributes
- Object
- Installation::AutoinstProfile::SectionWithAttributes
- Y2Network::AutoinstProfile::RouteSection
- Defined in:
- src/lib/y2network/autoinst_profile/route_section.rb
Overview
This class represents an AutoYaST
Instance Attribute Summary collapse
-
#destination ⇒ String
Route destination.
-
#device ⇒ String
Interface name.
-
#extrapara ⇒ String
Route options.
-
#gateway ⇒ String
Route gateway.
-
#netmask ⇒ String
Netmask.
Class Method Summary collapse
- .attributes ⇒ Object
-
.new_from_network(route, parent = nil) ⇒ RouteSection
Clones a network route into an AutoYaST route section.
Instance Method Summary collapse
-
#collection_name ⇒ String
Returns the collection name.
-
#init_from_hashes(hash) ⇒ Boolean
Method used by new_from_hashes to populate the attributes.
-
#init_from_route(route) ⇒ Boolean
Method used by RouteSection.new_from_network to populate the attributes when cloning a network route.
Instance Attribute Details
#destination ⇒ String
Returns Route destination.
|
# File 'src/lib/y2network/autoinst_profile/route_section.rb', line 48
|
#device ⇒ String
Returns Interface name.
|
# File 'src/lib/y2network/autoinst_profile/route_section.rb', line 51
|
#extrapara ⇒ String
Returns Route options.
|
# File 'src/lib/y2network/autoinst_profile/route_section.rb', line 54
|
#gateway ⇒ String
Returns Route gateway.
|
# File 'src/lib/y2network/autoinst_profile/route_section.rb', line 57
|
#netmask ⇒ String
Returns Netmask.
|
# File 'src/lib/y2network/autoinst_profile/route_section.rb', line 60
|
Class Method Details
.attributes ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'src/lib/y2network/autoinst_profile/route_section.rb', line 36 def self.attributes [ { name: :destination }, { name: :netmask }, { name: :device }, { name: :gateway }, { name: :extrapara } ] end |
.new_from_network(route, parent = nil) ⇒ RouteSection
Clones a network route into an AutoYaST route section
68 69 70 71 72 |
# File 'src/lib/y2network/autoinst_profile/route_section.rb', line 68 def self.new_from_network(route, parent = nil) result = new(parent) result.init_from_route(route) result end |
Instance Method Details
#collection_name ⇒ String
Returns the collection name
104 105 106 |
# File 'src/lib/y2network/autoinst_profile/route_section.rb', line 104 def collection_name "routes" end |
#init_from_hashes(hash) ⇒ Boolean
Method used by new_from_hashes to populate the attributes.
78 79 80 81 82 83 84 85 86 |
# File 'src/lib/y2network/autoinst_profile/route_section.rb', line 78 def init_from_hashes(hash) @destination = destination_from_hash(hash) @gateway = gateway_from_hash(hash) @netmask = netmask_from_hash(hash) @device = device_from_hash(hash) @extrapara = hash["extrapara"] true end |
#init_from_route(route) ⇒ Boolean
Method used by new_from_network to populate the attributes when cloning a network route
92 93 94 95 96 97 98 99 |
# File 'src/lib/y2network/autoinst_profile/route_section.rb', line 92 def init_from_route(route) @destination = destination_from_route(route) @netmask = netmask_from_route(route) @device = device_from_route(route) @gateway = gateway_from_route(route) @extrapara = extrapara_from_route(route) true end |