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

Examples:

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

Returns:

  • (Hash)

    of parameters



101
102
103
104
# File 'library/control/src/modules/GetInstArgs.rb', line 101

def argmap
  Init()
  deep_copy(@args)
end

#Buttons(back, next_) ⇒ Hash

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

Examples:

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

Returns:

  • (Hash)

    of parameters



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

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"

Examples:

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

Returns:

  • (Hash)

    of parameters



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

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



64
65
66
67
# File 'library/control/src/modules/GetInstArgs.rb', line 64

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



56
57
58
59
# File 'library/control/src/modules/GetInstArgs.rb', line 56

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



72
73
74
75
# File 'library/control/src/modules/GetInstArgs.rb', line 72

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

#InitObject



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

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



31
32
33
# File 'library/control/src/modules/GetInstArgs.rb', line 31

def main
  @args = {}
end

#proposalString

Returns name of the proposal

Examples:

GetInstArgs::proposal() -> "initial"
GetInstArgs::proposal() -> "network"
GetInstArgs::proposal() -> "hardware"

Returns:



85
86
87
88
# File 'library/control/src/modules/GetInstArgs.rb', line 85

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