Class: Y2Network::Widgets::InterfaceType

Inherits:
CWM::RadioButtons
  • Object
show all
Defined in:
src/lib/y2network/widgets/interface_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(default: nil) ⇒ InterfaceType

Returns a new instance of InterfaceType.


28
29
30
31
32
# File 'src/lib/y2network/widgets/interface_type.rb', line 28

def initialize(default: nil)
  textdomain "network"
  # eth as default
  @default = default || "eth"
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.


27
28
29
# File 'src/lib/y2network/widgets/interface_type.rb', line 27

def result
  @result
end

Instance Method Details

#helpObject


38
39
40
41
42
43
44
# File 'src/lib/y2network/widgets/interface_type.rb', line 38

def help
  # FIXME: help is not helpful
  _(
    "<p><b>Device Type</b>. Various device types are available, select \n" \
      "one according your needs.</p>"
  )
end

#initObject


46
47
48
# File 'src/lib/y2network/widgets/interface_type.rb', line 46

def init
  self.value = @default
end

#itemsObject


50
51
52
53
54
# File 'src/lib/y2network/widgets/interface_type.rb', line 50

def items
  Y2Network::InterfaceType.supported.map do |type|
    [type.short_name, type.to_human_string]
  end
end

#labelObject


34
35
36
# File 'src/lib/y2network/widgets/interface_type.rb', line 34

def label
  _("&Device Type")
end

#storeObject


56
57
58
# File 'src/lib/y2network/widgets/interface_type.rb', line 56

def store
  @result = value
end