GeekNationgeeknation.joshisfitness.com·Jan 27, 2024CrystalLang-BlocksA block is the same thing as a method, but it does not belong to an object. Blocks are called closures in other programming languages. There are some important points about Blocks in crystal: Block can accept arguments and returns a value. ...Discusscrystal
GeekNationgeeknation.joshisfitness.com·Jan 13, 2024CrystalLang-Initialize MethodThe initialize method is useful when we want to initialize some class variables at the time of object creation. The initialize method is part of the object-creation process in Crystal and it allows us to set the initial values for an object. Below ar...Discusscrystal
GeekNationgeeknation.joshisfitness.com·Jan 4, 2024CrystalLang-IteratorsThe word iterate means doing one thing multiple times and that is what iterators do. Sometimes iterators are termed as the custom loops. “Iterators” is the object-oriented concept in crystal. In more simple words, iterators are the methods w...Discusscrystal
GeekNationgeeknation.joshisfitness.com·Dec 28, 2023CrystalLang-Static MembersIn crystal lang, static members are known as class variables. These variables are shared among all instances of a class and are declared using the @@ symbol. Class variables retain their value across different instances of the class and can be access...Discusscrystal
GeekNationgeeknation.joshisfitness.com·Dec 26, 2023CrystalLang-LambdaIn CrystalLang, a lambda is a type of anonymous function or a block of code that can be assigned to a variable or used inline. It encapsulates control flow, parameters, and local variables into a single package. lambda_variable = ->(param) { p...Discusscrystal
GeekNationgeeknation.joshisfitness.com·Dec 24, 2023CrystalLang-PolymorphismIn Crystal, one does not have anything like the variable types as there is in other programming languages. Every variable is an “object” which can be individually modified. One can easily add methods and functions on every object. So here, the Object...Discusscrystal
GeekNationgeeknation.joshisfitness.com·Dec 23, 2023CrystalLang-EncapsulationEncapsulation is defined as the wrapping up of data under a single unit. It is the mechanism that binds together code and the data it manipulates. In a different way, encapsulation is a protective shield that prevents the data from being accessed by ...Discusscrystal
Seth T.Proseesethcode.hashnode.dev·Dec 4, 2023Integrating Jennifer & Amber v1.0+To get the full experience with Jennifer, we'll first want to install sam. This is Jennifer's CLI tool that has generators for creating models, managing the db creation/resetting, migrations, etc. that aren't currently able to be added quickly and ea...Discuss·100 readsactiverecord
Kirk HainesProwyhaines.hashnode.dev·Jun 4, 2023Stretching the Language with Macros; Implementing a `for` Loop In CrystalThis article was originally published a couple of years ago on New Relic's now-defunct Relicans site. I am reprinting it here as I was the original author. What Are Crystal's Looping Structures? The Crystal language offers three different language-l...Discuss·41 readscrystal
Kirk HainesProwyhaines.hashnode.dev·Jan 30, 2023Base58 - What Is it? Why Use It?As programmers, we are familiar with using numbers in different bases. We know about the binary, or base 2 system, that underlies our hardware. We are also usually aware of hexadecimal, or base 16, numbers because they are ubiquitous in many areas of...Discuss·10 likes·3.6K readsRust