Class: Yast::ArgRef

Inherits:
Object
  • Object
show all
Defined in:
src/ruby/yast/arg_ref.rb,
src/ruby/yast/builtins.rb

Overview

Provides wrapper to pass by reference any value, even immutable like Fixnum or Symbol. It is used by component system to allow passing by reference.

Examples:

pass value as reference

#Component function void T::test(integer &)
a = 6
ref_a = ArgRef.new a
T.test(ref_a)
a = ref_a.value

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(initial = nil) ⇒ ArgRef



15
16
17
# File 'src/ruby/yast/arg_ref.rb', line 15

def initialize(initial = nil)
  @value = initial
end

Instance Attribute Details

#valueObject

Returns the value of attribute value



13
14
15
# File 'src/ruby/yast/arg_ref.rb', line 13

def value
  @value
end