Logical or Boolean false, instance of FalseClass. Terminates a while or until loop or a method inside a block.Ĭompares an expression with a matching when clause closes with end.ĭetermines if a variable, method, super method, or block exists.īegins a block and executes code in that block closes with end.Įxecutes if previous conditional, in if, elsif, unless, or when, is not true.Įxecutes if previous conditional, in if or elsif, is not true.Įnds a code block (group of statements) starting with begin, def, do, if, etc.Īlways executes at block termination use after last rescue. Logical operator same as & except and has lower precedence.īegins a code block or group of statements closes with end. Starts with : Reserved words Reserved WordĬode, enclosed in, to run when the program ends.Ĭreates an alias for an existing method, operator, or global variable. Starts with uppercase letter, by convention they are named using MixedCase Constants Starts with uppercase letter, by convention they are named using MixedCase Starts with an underscore or lowercase letter Additionally, a symbol is unique 100% of the time. The name of a method may end with =, !, or ?Ī symbol is a constant name that doesn’t require pre-declaration. You need to divide multiword variables by placing an underscore between each word pair.Īdditionally you need to capitalize the first letter of each word. However you can’t place a number right after the symbol. Ruby class and module names are also constants, but they are conventionally written using initial capital letters and camel case, LikeThis.Īfter the first character, you may combine numbers, letters, and underscores to create a unique name. The Ruby convention is to use underscores to separate words in a multiword method or variable name.īy convention, most constants are written in all uppercase with underscores to separate words, LIKE_THIS. Uppercase letter means the characters “A” through “Z”.Ī name is an uppercase letter, lowercase letter, or an underscore (“_”), followed by Name characters (this is any combination of upper- and lowercase letters, underscore and digits). ![]() Lowercase letter means the characters “a” through “z”. It uses the first character of an identifier to determine its purpose.Ĭertain names, are reserved words and should not be used as variable, method, class, or module name. ![]() Ruby uses a unique convention for naming objects:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |