Class: Y2Network::Widgets::Devices
- Inherits:
-
CWM::ComboBox
- Object
- CWM::ComboBox
- Y2Network::Widgets::Devices
- Defined in:
- src/lib/y2network/widgets/devices.rb
Instance Method Summary collapse
- #help ⇒ Object
- #init ⇒ Object
-
#initialize(route, available_devices) ⇒ Devices
constructor
A new instance of Devices.
- #items ⇒ Object
- #label ⇒ Object
- #opt ⇒ Object
- #store ⇒ Object
Constructor Details
#initialize(route, available_devices) ⇒ Devices
Returns a new instance of Devices.
27 28 29 30 31 32 |
# File 'src/lib/y2network/widgets/devices.rb', line 27 def initialize(route, available_devices) textdomain "network" @devices = available_devices @route = route end |
Instance Method Details
#help ⇒ Object
38 39 40 41 42 43 |
# File 'src/lib/y2network/widgets/devices.rb', line 38 def help _( "<p><b>Device</b> specifies the device through which the traffic" \ " to the defined network will be routed.</p>" ) end |
#init ⇒ Object
54 55 56 57 |
# File 'src/lib/y2network/widgets/devices.rb', line 54 def init interface = @route.interface self.value = interface ? interface.name : "" end |
#items ⇒ Object
45 46 47 48 |
# File 'src/lib/y2network/widgets/devices.rb', line 45 def items # TODO: maybe some translated names? @devices.map { |d| [d, d] } end |
#label ⇒ Object
34 35 36 |
# File 'src/lib/y2network/widgets/devices.rb', line 34 def label _("De&vice") end |
#opt ⇒ Object
50 51 52 |
# File 'src/lib/y2network/widgets/devices.rb', line 50 def opt [:hstretch, :editable] end |