code registre se connecter programmes messages télécharger à propos confidentialité termes anglais production
accueil / documentation
22 exemples
Base64
exemples
base64 encode hello to a g v s b g 8 equals new line
entrée
Base64.encode(:hello)
résultat
"aGVsbG8=\n"
base64 strict encode hello to a g v s b g 8 equals
entrée
Base64.strict_encode(:hello)
résultat
"aGVsbG8="
base64 urlsafe encode hello
entrée
Base64.urlsafe_encode(:hello)
résultat
"aGVsbG8="
fonctions de classe
Boolean
exemples
not true
entrée
!true
résultat
false
boolean new a
entrée
Boolean.new(:a)
résultat
true
false
entrée
false
résultat
false
true
entrée
true
résultat
true
fonctions d'instance
Class
exemples
boolean code object boolean
entrée
Boolean
résultat
Code::Object::Boolean
class new true code object boolean
entrée
Class.new(true)
résultat
Code::Object::Boolean
list code object list
entrée
List
résultat
Code::Object::List
Code
exemples
code node code object
entrée
Code.new
résultat
#<Code::Node::Code:0x000000013065cf30>
Context
exemples
context new
entrée
Context.new
résultat
{}
Current
exemples
current user nothing
entrée
Current.user
résultat
nothing
current user not nil
entrée
Current.user!
résultat
{"id" => 3}
current user id
entrée
Current.user.id
résultat
3
current user exclamation id
entrée
Current.user!.id
résultat
3
fonctions d'instance
Date
exemples
date new 2025 06 21
entrée
Date.new
résultat
2025-06-21
date today 2025 06 21
entrée
Date.today
résultat
2025-06-21
date tomorrow 2025 06 22
entrée
Date.tomorrow
résultat
2025-06-22
date yesterday 2025 06 20
entrée
Date.yesterday
résultat
2025-06-20
fonctions de classe
fonctions d'instance
Decimal
exemples
number literal
entrée
1.0
résultat
1.0
scientific notation example
entrée
1e1.0
résultat
10.0
scientific notation
entrée
2.3e2
résultat
230.0
fonctions d'instance
Dictionary
exemples
dictionary not operator evaluation
entrée
!{}
résultat
false
dictionary new
entrée
Dictionary.new
résultat
{}
dictionary new access a
entrée
Dictionary.new(a: 1, b: 2).a
résultat
1
dictionary access b
entrée
{ a: 1, b: 2 }.b
résultat
2
dictionary empty
entrée
{}
résultat
{}
dictionary equality comparison
entrée
{} == {}
résultat
true
dictionary to list
entrée
{}.to_list
résultat
[]
fonctions d'instance
Duration
exemples
duration 1 day ago example
entrée
1.day.ago
résultat
2025-06-20 18:22:07 UTC
one day from now
entrée
1.day.from_now
résultat
2025-06-22 18:22:07 UTC
two days ago
entrée
2.days.ago
résultat
2025-06-19 18:22:07 UTC
three days from now
entrée
3.days.from_now
résultat
2025-06-24 18:22:07 UTC
fonctions d'instance
Function
exemples
sum_two_numbers_with_arrow_function
entrée
sum = (a, b) => { a + b } sum(1, 2)
résultat
3
sum with default parameter
entrée
sum = (a, b = 2) => { a + b } sum(1)
résultat
3
sum with defaults
entrée
sum = (a = 1, b = 2) => { a + b } sum()
résultat
3
sum with default shorthand
entrée
sum = (a, b: 2) => { a + b } sum(1)
résultat
3
sum with default shorthand
entrée
sum = (a: 1, b: 2) => { a + b } sum()
résultat
3
arrow function call
entrée
(a, b) => { a + b }.call(1, 2)
résultat
3
arrow function call with default
entrée
(a, b = 2) => { a + b }.call(1)
résultat
3
arrow function call with parameters
entrée
(a = 1, b = 2) => { a + b }.call
résultat
3
arrow function call default
entrée
(a, b: 2) => { a + b }.call(1)
résultat
3
arrow function call shorthand default
entrée
(a: 1, b: 2) => { a + b }.call
résultat
3
fonctions d'instance
Global
exemples
p
entrée
p(nothing)
sortie
nothing
résultat
nothing
puts
entrée
puts(:hello)
sortie
hello
résultat
nothing
fonctions d'instance
Html
exemples
html link to
entrée
Html.link_to(:code, "https://codedorian.com")
résultat
"<a\n href=\"https://codedorian.com\"\n>code</a>"
html get body
entrée
Html.new(Http.get("https://codedorian.com").body)
résultat
home { "imports": { "application": "/assets/application-e0d7a278.js", "i18n": "/assets/i18n-7dcd85d7.js", "debounce": "/assets/debounce-a930f328.js", "constants": "/assets/constants-49b63b98.js", "@hotwired/turbo-rails": "/assets/turbo.min-d29e2e9c.js", "@hotwired/stimulus": "/assets/@hotwired--stimulus-bf4d6596.js", "@hotwired/stimulus-loading": "/assets/stimulus-loading-25917588.js", "intl-tel-input": "/assets/intl-tel-input-dadaf5a5.js", "intl-tel-input/build/js/utils.js": "/assets/intl-tel-input--build--js--utils.js-acd342d8.js", "stimulus-places-autocomplete": "/assets/stimulus-places-autocomplete-38257916.js", "@googlemaps/js-api-loader": "/assets/@googlemaps--js-api-loader-5c595193.js", "@hotwired/turbo": "/assets/@hotwired--turbo-14cff50d.js", "local-time": "/assets/local-time-132c1462.js", "trix": "/assets/trix-abaf7ced.js", "@rails/actiontext": "/assets/actiontext.esm-65176861.js", "@hotwired/hotwire-native-bridge": "/assets/@hotwired--hotwire-native-bridge-a20f8bf0.js", "controllers/address_controller": "/assets/controllers/address_controller-9864d68c.js", "controllers/application": "/assets/controllers/application-e8439b16.js", "controllers/bridge/button_controller": "/assets/controllers/bridge/button_controller-a98cecdb.js", "controllers/bridge/confirm_controller": "/assets/controllers/bridge/confirm_controller-1efa3982.js", "controllers/bridge/csrf_token_controller": "/assets/controllers/bridge/csrf_token_controller-6c63f3d9.js", "controllers/bridge/menu_controller": "/assets/controllers/bridge/menu_controller-a37178cf.js", "controllers/bridge/notification_token_controller": "/assets/controllers/bridge/notification_token_controller-9f407479.js", "controllers/bridge/share_controller": "/assets/controllers/bridge/share_controller-cac6b78f.js", "controllers/bridge/tab_bar_controller": "/assets/controllers/bridge/tab_bar_controller-640182ba.js", "controllers/confirm_controller": "/assets/controllers/confirm_controller-8c0e49e2.js", "controllers": "/assets/controllers/index-49968974.js", "controllers/modal_controller": "/assets/controllers/modal_controller-2fddee3b.js", "controllers/nested_controller": "/assets/controllers/nested_controller-280ff326.js", "controllers/password_controller": "/assets/controllers/password_controller-d9394a90.js", "controllers/phone_number_controller": "/assets/controllers/phone_number_controller-35684aef.js", "controllers/recaptcha_controller": "/assets/controllers/recaptcha_controller-17a54e10.js", "controllers/search_controller": "/assets/controllers/search_controller-f0597ed7.js", "controllers/time_zone_controller": "/assets/controllers/time_zone_controller-f73f8051.js", "controllers/update_time_zone_controller": "/assets/controllers/update_time_zone_controller-49264196.js", "controllers/validation_controller": "/assets/controllers/validation_controller-1edf9896.js" } } import "application" window.DEFAULT_COUNTRY_CODE = "FR"; window.time_zone = ""; window.translations = {"address":{"not_present":"must be present","not_valid":"must be valid"},"password":{"not_present":"must be present"},"phone_number":{"invalid_country_code":"has invalid country code","invalid_length":"has invalid length","invalid_phone_number":"is invalid phone number","is_possible":"is possible","is_possible_local_only":"is possible local only","not_present":"must be present","not_valid":"must be valid","too_long":"is too long","too_short":"is too short"},"time_zone":{"not_present":"must be present"},"trix":{"GB":"gb","KB":"kb","MB":"mb","PB":"pb","TB":"tb","attachFiles":"attach files","bold":"bold","bullets":"bullets","byte":"byte","bytes":"bytes","captionPlaceholder":"add a caption…","code":"code","heading1":"heading","indent":"increase level","italic":"italic","link":"link","numbers":"numbers","outdent":"decrease level","quote":"quote","redo":"redo","remove":"remove","strike":"strikethrough","undo":"undo","unlink":"unlink","url":"url","urlPlaceholder":"enter a url…"},"validation":{"not_email":{"feminine":"must be an email address","masculine":"must be an email address"},"not_present":{"feminine":"must be present","masculine":"must be present"},"not_valid":{"feminine":"must be valid","masculine":"must be valid"}}}; window.platform = "unknown_platform"; window.RECAPTCHA_SITE_KEY = "6LdjmAgrAAAAADaoiIRITe8uIMYbTL2Sm_0Kg2UB"; window.GOOGLE_MAPS_API_KEY = "AIzaSyDLTR8T-yeNQvbTHF2NibLVwYpYy1-hzm4"; code guest register log in programs messages repl documentation source about privacy terms /up french production home welcome to code the programming language for the internet age here you can use, create, schedule, execute, and manage your programs
fonctions de classe
fonctions d'instance
Http
exemples
http get keys
entrée
Http.get("https://codedorian.com").keys
résultat
["code", "status", "body"]
http get code
entrée
Http.get("https://codedorian.com").code
résultat
200
http get status
entrée
Http.get("https://codedorian.com").status
résultat
"ok"
http get body size
entrée
Http.get("https://codedorian.com").body.size
résultat
14234
fonctions de classe
IdentifierList
exemples
identifier list empty
entrée
IdentifierList.new
résultat
[]
identifier list create
entrée
IdentifierList.new([:a, :b, :c])
résultat
["a", "b", "c"]
Integer
exemples
integer
entrée
1
résultat
1
integer
entrée
1000000000000000
résultat
1000000000000000
large integer
entrée
1e100
résultat
10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
fonctions d'instance
Json
exemples
json parse a nothing
entrée
Json.parse('{"a": 1}')
résultat
nothing
json parse with response body
entrée
response = { body: '{"a": 1}' } Json.parse(response.body)
résultat
nothing
fonctions de classe
List
exemples
list new
entrée
List.new
résultat
[]
list all elements
entrée
[1, 2, 3]
résultat
[1, 2, 3]
list symbols
entrée
[:a, :b, :c]
résultat
["a", "b", "c"]
empty list
entrée
[]
résultat
[]
fonctions d'instance
Message
exemples
message create id 27
entrée
Message.create
résultat
{"id" => 27}
message create exclamation id 28
entrée
Message.create!
résultat
{"id" => 28}
message create exclamation body world
entrée
Message.create!(body: :world)
résultat
{"id" => 29}
message create exclamation subject hello
entrée
Message.create!(subject: :hello)
résultat
{"id" => 30}
message create exclamation subject hello body world
entrée
Message.create!(subject: :hello, body: :world)
résultat
{"id" => 31}
fonctions de classe
Nothing
exemples
nothing new
entrée
Nothing.new
résultat
nothing
nothing
entrée
nothing
résultat
nothing
Notification
exemples
notification create true
entrée
Notification.create
résultat
true
notification create no error empty object
entrée
Notification.create!
résultat
{}
notification create no error empty object
entrée
Notification.create!(body: :world)
résultat
{}
notification create subject hello no error
entrée
Notification.create!(subject: :hello)
résultat
{}
notification create subject hello body world
entrée
Notification.create!(subject: :hello, body: :world)
résultat
{}
notification create no error empty object
entrée
Notification.create!(subject: :hello, path: :documentation, sound: :default)
résultat
{}
fonctions de classe
Number
exemples
number object number
entrée
Number
résultat
Code::Object::Number
Object
exemples
object new
entrée
Object.new
résultat
nothing
array not equal dictionary
entrée
[] != {}
résultat
true
not strictly equal
entrée
1 !== true
résultat
true
list new equal empty array
entrée
List.new == []
résultat
true
dictionary new strictly equal empty dictionary
entrée
Dictionary.new === {}
résultat
true
fonctions de classe
fonctions d'instance
Parameter
exemples
parameter new empty
entrée
Parameter.new
résultat
{}
parameter new with args
entrée
Parameter.new(a: 1, b: 2)
résultat
{"a" => 1, "b" => 2}
Range
exemples
range to list
entrée
(0...10).to_list
résultat
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
range to list
entrée
(1..10).to_list
résultat
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
fonctions d'instance
Smtp
exemples
smtp new initialization
entrée
smtp = Smtp.new( address: "smtp.gmail.com", port: 587, user_name: "dorian@dorianmarie.com", password: "my-secret-password", authentication: :plain, enable_starttls_auto: true, ) # smtp.send( # from: "dorian+sender@dorianmarie.com", # to: "dorian+receiver@dorianmarie.com", # subject: "date is {Date.today}", # body_html: "time is {Time.now}", # )
résultat
{"address" => "smtp.gmail.com", "port" => 587, "user_name" => "dorian@dorianmarie.com", "password" => "my-secret-password", "authentication" => "plain", "enable_starttls_auto" => true}
fonctions d'instance
String
exemples
hello world
entrée
"hello world"
résultat
"hello world"
one to string
entrée
1.to_string
résultat
"1"
symbol to string
entrée
:hello
résultat
"hello"
string new hello
entrée
String.new(:hello)
résultat
"hello"
hello days from now
entrée
"hello {2.days.from_now}"
résultat
"hello 2025-06-23 18:23:04 UTC"
fonctions d'instance
Time
exemples
time hour
entrée
Time.hour
résultat
18
time minutes
entrée
Time.minutes
résultat
23
time now
entrée
Time.now
résultat
2025-06-21 18:23:04 UTC
fonctions de classe
fonctions d'instance
User
exemples
user new empty result
entrée
User.new
résultat
{}
fonctions de classe
Program
exemples
program new empty result
entrée
Program.new
résultat
{}
fonctions de classe
Schedule
exemples
schedule new empty result
entrée
Schedule.new
résultat
{}
fonctions de classe