Handle BasicObject
instances
Set
local variable named symbol
as obj
.
def foo a = 1 bind = binding bind.local_variable_set(:a, 2) # set existing local variable `a' bind.local_variable_set(:b, 3) # create new local variable `b' # `b' exists only in binding p bind.local_variable_get(:a) #=> 2 p bind.local_variable_get(:b) #=> 3 p a #=> 2 p b #=> NameError end
This method behaves similarly to the following code:
binding.eval("#{symbol} = #{obj}")
if obj
can be dumped in Ruby code.
Sets a thread local with key
to value
. Note that these are local to threads, and not to fibers. Please see Thread#thread_variable_get
and Thread#[]
for more information.
Attempts to enter exclusive section. Returns false
if lock fails.
For backward compatibility
obj can be an instance of InternalObjectWrapper
.
Note that you should not use this method in your application.
The number of paths in the ‘$LOAD_PATH` from activated gems. Used to prioritize `-I` and `ENV` entries during `require`.
The default signing certificate chain path
Like Enumerable#select
, but chains operation to be lazy-evaluated.
Like Enumerable#select
, but chains operation to be lazy-evaluated.
Like Enumerable#drop
, but chains operation to be lazy-evaluated.
Emit a scalar with value
and tag
Emit a sequence with list
and tag
Called when a sequence is started.
anchor
is the anchor associated with the sequence or nil. tag
is the tag associated with the sequence or nil. implicit
a boolean indicating whether or not the sequence was implicitly started. style
is an integer indicating the list style.
See the constants in Psych::Nodes::Sequence
for the possible values of style
.
Here is a YAML document that exercises most of the possible ways this method can be called:
--- - !!seq [ a ] - &pewpew - b
The above YAML document consists of three lists, an outer list that contains two inner lists. Here is a matrix of the parameters sent to represent these lists:
# anchor tag implicit style [nil, nil, true, 1 ] [nil, "tag:yaml.org,2002:seq", false, 2 ] ["pewpew", nil, true, 1 ]
Start emitting a sequence with anchor
, a tag
, implicit
sequence start and end, along with style
.
This method is called when a parse error is found.
ERROR_TOKEN_ID is an internal ID of token which caused error. You can get string representation of this ID by calling token_to_str
.
ERROR_VALUE is a value of error token.
value_stack is a stack of symbol values. DO NOT MODIFY this object.
This method raises ParseError
by default.
If this method returns, parsers enter “error recovering mode”.