Class: Yast::GetInstArgsClass

Inherits:
Module
  • Object
show all
Defined in:
library/control/src/modules/GetInstArgs.rb

Instance Method Summary collapse

Instance Method Details

#argmapHash

Returns map of client parameters

GetInstArgs::argmap() -> $[ “enable_back” : true, “enable_next” : true, “going_back” : true, “anything” : “yes, of course”, ]

Returns:

  • (Hash)

    of parameters



103
104
105
106
# File 'library/control/src/modules/GetInstArgs.rb', line 103

def argmap
  Init()
  deep_copy(@args)
end

#Buttons(back, next_) ⇒ Hash

Returns map of client parameters only with keys: “enable_back” and “enable_next”

GetInstArgs::Buttons() -> $[ “enable_back” : false, “enable_next” : true ]

Returns:

  • (Hash)

    of parameters



137
138
139
140
141
142
# File 'library/control/src/modules/GetInstArgs.rb', line 137

def Buttons(back, next_)
  {
    "enable_back" => back,
    "enable_next" => next_
  }
end

#ButtonsProposal(back, next_, proposal_name) ⇒ Hash

Returns map of client parameters only with keys: “enable_back”, “enable_next”, and “proposal”

GetInstArgs::ButtonsProposal() -> $[ “enable_back” : true, “enable_next” : true, “proposal” : “initial” ]

Returns:

  • (Hash)

    of parameters



119
120
121
122
123
124
125
# File 'library/control/src/modules/GetInstArgs.rb', line 119

def ButtonsProposal(back, next_, proposal_name)
  {
    "enable_back" => back,
    "enable_next" => next_,
    "proposal"    => proposal_name
  }
end

#enable_backBoolean

Should be the [Back] button enabled?

Returns:

  • (Boolean)

    whether enabled or not



66
67
68
69
# File 'library/control/src/modules/GetInstArgs.rb', line 66

def enable_back
  Init()
  Ops.get_boolean(@args, "enable_back", false)
end

#enable_nextBoolean

Should be the [Next] button enabled?

Returns:

  • (Boolean)

    whether enabled or not



58
59
60
61
# File 'library/control/src/modules/GetInstArgs.rb', line 58

def enable_next
  Init()
  Ops.get_boolean(@args, "enable_next", false)
end

#going_backBoolean

Are we going back from the previous dialog?

Returns:

  • (Boolean)

    whether going_back or not



74
75
76
77
# File 'library/control/src/modules/GetInstArgs.rb', line 74

def going_back
  Init()
  Ops.get_boolean(@args, "going_back", false)
end

#InitObject



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'library/control/src/modules/GetInstArgs.rb', line 37

def Init
  # Check arguments
  @args = {}
  i = 0
  # assign to args first available map
  # (in proposals, first argument is string - bnc#475169)
  while Ops.less_than(i, Builtins.size(WFM.Args))
    if Ops.is_map?(WFM.Args(i))
      @args = Convert.to_map(WFM.Args(i))
      break
    end
    i = Ops.add(i, 1)
  end
  Builtins.y2milestone("args=%1", @args)

  nil
end

#mainObject



33
34
35
# File 'library/control/src/modules/GetInstArgs.rb', line 33

def main
  @args = {}
end

#proposalString

Returns name of the proposal

GetInstArgs::proposal() -> “initial” GetInstArgs::proposal() -> “network” GetInstArgs::proposal() -> “hardware”

Returns:



87
88
89
90
# File 'library/control/src/modules/GetInstArgs.rb', line 87

def proposal
  Init()
  Ops.get_string(@args, "proposal", "")
end