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.



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

def initialize(default: nil)
  super()
  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



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

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



48
49
50
# File 'src/lib/y2network/widgets/interface_type.rb', line 48

def init
  self.value = @default
end

#itemsObject



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

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

#labelObject



36
37
38
# File 'src/lib/y2network/widgets/interface_type.rb', line 36

def label
  _("&Device Type")
end

#storeObject



58
59
60
# File 'src/lib/y2network/widgets/interface_type.rb', line 58

def store
  @result = value
end