This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
<title></title> | |
<meta charset="UTF-8"> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Encrypts a provided string using the Rot13 cipher | |
function rot13(string) { | |
function rotate(char, limit) { | |
var rotatedCharCode = char.charCodeAt(0) + 13; | |
if (rotatedCharCode > limit) { | |
rotatedCharCode -= 26; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Employee | |
def greeting | |
puts "Good morning boss!" | |
end | |
end | |
class Spouse | |
def greeting | |
puts "Hi honey!" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def top_level_inspect_self | |
p self | |
end | |
top_level_inspect_self # main | |
p Object.private_methods.include?(:top_level_inspect_self) # true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyModule | |
def self.module_inspect_self | |
p self | |
end | |
end | |
class MyClass | |
def instance_inspect_self | |
p self | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass | |
def instance_inspect_self | |
p self | |
end | |
def self.class_inspect_self | |
p self | |
end | |
def self.announce_and_inspect_self |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my_instance = MyClass.new | |
my_instance.instance_inspect_self # <MyClass:0x00000000a88dd8> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = 4 | |
b = 2 | |
c = a + b | |
puts c #=> 6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a.class # => Integer | |
a.public_methods.include?(:+) # => true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1, 2, 3].public_methods.include?(:==) # => true | |
42.public_methods.include?(:==) # => true |
OlderNewer