Linux server1.dn-server.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
LiteSpeed
Server IP : 195.201.204.189 & Your IP : 216.73.217.130
Domains :
Cant Read [ /etc/named.conf ]
User : beriska1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
alt /
ruby33 /
share /
doc /
alt-ruby33-doc /
syntax /
Delete
Unzip
Name
Size
Permission
Date
Action
assignment.rdoc
11.87
KB
-rw-r--r--
2026-03-26 03:35
calling_methods.rdoc
11.26
KB
-rw-r--r--
2026-03-26 03:35
comments.rdoc
7.32
KB
-rw-r--r--
2026-03-26 03:35
control_expressions.rdoc
16.09
KB
-rw-r--r--
2026-03-26 03:35
exceptions.rdoc
2.16
KB
-rw-r--r--
2026-03-26 03:35
literals.rdoc
15.72
KB
-rw-r--r--
2026-03-26 03:35
methods.rdoc
16.92
KB
-rw-r--r--
2026-03-26 03:35
miscellaneous.rdoc
3.78
KB
-rw-r--r--
2026-03-26 03:35
modules_and_classes.rdoc
8.58
KB
-rw-r--r--
2026-03-26 03:35
operators.rdoc
2.35
KB
-rw-r--r--
2026-03-26 03:35
pattern_matching.rdoc
13.01
KB
-rw-r--r--
2026-03-26 03:35
precedence.rdoc
1.09
KB
-rw-r--r--
2026-03-26 03:35
refinements.rdoc
6.83
KB
-rw-r--r--
2026-03-26 03:35
Save
Rename
= Operators In Ruby, operators such as <code>+</code>, are defined as methods on the class. Literals[rdoc-ref:syntax/literals.rdoc] define their methods within the lower level, C language. String class, for example. Ruby objects can define or overload their own implementation for most operators. Here is an example: class Foo < String def +(str) self.concat(str).concat("another string") end end foobar = Foo.new("test ") puts foobar + "baz " This prints: test baz another string What operators are available is dependent on the implementing class. == Operator Behavior How a class behaves to a given operator is specific to that class, since operators are method implementations. When using an operator, it's the expression on the left-hand side of the operation that specifies the behavior. 'a' * 3 #=> "aaa" 3 * 'a' # TypeError: String can't be coerced into Integer == Logical Operators Logical operators are not methods, and therefor cannot be redefined/overloaded. They are tokenized at a lower level. Short-circuit logical operators (<code>&&</code>, <code>||</code>, <code>and</code>, and <code>or</code>) do not always result in a boolean value. Similar to blocks, it's the last evaluated expression that defines the result of the operation. === <code>&&</code>, <code>and</code> Both <code>&&</code>/<code>and</code> operators provide short-circuiting by executing each side of the operator, left to right, and stopping at the first occurrence of a falsey expression. The expression that defines the result is the last one executed, whether it be the final expression, or the first occurrence of a falsey expression. Some examples: true && 9 && "string" #=> "string" (1 + 2) && nil && "string" #=> nil (a = 1) && (b = false) && (c = "string") #=> false puts a #=> 1 puts b #=> false puts c #=> nil In this last example, <code>c</code> was initialized, but not defined. === <code>||</code>, <code>or</code> The means by which <code>||</code>/<code>or</code> short-circuits, is to return the result of the first expression that is truthy. Some examples: (1 + 2) || true || "string" #=> 3 false || nil || "string" #=> "string"