Module: Installation::Widgets::SystemRoleReader
- Included in:
- SystemRolesRadioButtons
- Defined in:
- src/lib/installation/system_role_reader.rb,
src/lib/installation/widgets/system_role_reader.rb
Overview
Common methods for system roles widgets
Instance Method Summary collapse
Instance Method Details
#default ⇒ Object
25 26 27 |
# File 'src/lib/installation/system_role_reader.rb', line 25 def default ::Installation::SystemRole.default? ? ::Installation::SystemRole.ids.first : nil end |
#help ⇒ Object
43 44 45 |
# File 'src/lib/installation/system_role_reader.rb', line 43 def help Yast::ProductControl.GetTranslatedText("roles_help") + "\n\n" + roles_help_text end |
#init ⇒ Object
29 30 31 |
# File 'src/lib/installation/system_role_reader.rb', line 29 def init self.value = ::Installation::SystemRole.current || default end |
#items ⇒ Object
37 38 39 40 41 |
# File 'src/lib/installation/system_role_reader.rb', line 37 def items ::Installation::SystemRole.all.map do |role| [role.id, role.label] end end |
#label ⇒ Object
33 34 35 |
# File 'src/lib/installation/system_role_reader.rb', line 33 def label Yast::ProductControl.GetTranslatedText("roles_caption") end |
#store ⇒ Object
47 48 49 50 51 52 53 |
# File 'src/lib/installation/system_role_reader.rb', line 47 def store log.info "Applying system role '#{value}'" role = ::Installation::SystemRole.select(value) role. role.adapt_services end |