- Ruby code to bytecode Our code’s journey before actually getting executed to the machine level.
- === Triple equal in ruby a === bIt means If (a) describes a set, would (b) a member of that set?```ruby(1..5) === 3 # => true(1..5) === 6 # => false
- :send method in ruby(Dynamic dispatch) Dynamic dispatch in ruby allows us to send messages to an object.
- Partial application and curring in ruby Partial function application is calling a function with some number of arguments, in order to get a function back that will take that many less arguments.
- :method_missing in rails When we call any random method on any object in rails which is not defined then rails handles it through a method method_missing.We can utilize the :method_missing in our code like below code -
- :dynamic_method in ruby Methods can be defined dynamically in ruby.Practially I felt like implementing :dynamic_method in my application when there were some values in the database and I had to create methods(method name) depending on those values.
- Variable hoisting in ruby Variable Hoisting is a mechanism by which the Ruby declares and defines variables.
- instance_eval method in ruby :instance_eval in ruby allows to execute a block in the context of another object.
- class_eval method in ruby :class_eval method is one of the way to define the class re-opening code in a more flexible manner.It works on any variable that references a class whereas re-opening a class requires defining a constant.
- Hook methods in ruby Hook methods are provided by the Ruby language that let you know about certain events such as when a class inherits from another class or when a method has been added to an object.
- Module namespace interpolation in rails type = 'baz'Foo::Bar.const_get(type.capitalize).new# => new instance of Foo::Bar::Baz
- bin folder in rails Working in Ruby on Rails, one should have a very clear understanding about the working of [rails s] with which we start our server and the /bin directory created in our project.
- Method class in ruby Ruby methods can be accessed as objects that are bound to a class. Methods aren’t technically objects in Ruby, but you can wrap them in objects.
- Ruby’s Binding Class (binding objects) A Binding is a whole scope packaged as an object. The idea is that you can create a Binding to capture the local scope and carry it around. Later, you can execute code in that scope by using the Binding object in conjunction with eval( ), instance_eval( ), or class_eval( ). You can create a binding with the Kernel#binding() method.
- Meta code Get the list of all associations defined on a Model
- Duplicating and Cloning objects in Ruby Objects can be duplicated in ruby if we want to retain the state of an object, but perform destructice acions on another object.
- DS programs in ruby Linked List
- Different ruby interpreters Interpreter is a program that reads your source code, converts it into a series of executable instructions and then run them.Its like a compiler but it runs our code directly without producing an output file.
- First class citizens in a programming language The notion of “first-class citizen” or “first-class element” in a programming language was introduced by British computer scientist Christopher Strachey in the 1960s in the context of first-class functions.
- How ruby variables reference objects In general, Ruby variables hold references to objects and do not hold values. In the following example, variable_one and variable_two both reference the “object_value” object.
- New methods introduced in ruby 2.5 Ruby 2.5Released on 25 Dec 2017. A lot of improvements were introduced in this release. New methods were part of this improvements.
- New features in Ruby 2.3.X Some new syntax’s were introduced in Ruby 2.3.0 to make coding simpler.
- Hash Keys(symbol vs string) in Ruby Problem - While using a normal hash in ruby, value for symbol type of key in the hash cannot be retrieved with equivalent string.
- Difference between == and === and eql? and equal? in ruby (==) compares the value of objects and returns true/false (eql?) compares the value of objects and returns true/false
- Multiline string in ruby () allows you to write single line string in mutiple lines in ruby code.
- nil? method in ruby in ruby .nil? on anything in ruby returns true or false based on whether its value is nil or not.
- Difference between += and concat Learning ruby is really fun and one should enjoy learning ruby language.
- Difference between && and (and) in Ruby Till the date I used to believe that in ruby && and (and) are completely replaceable but in actual its not the case at all.
- Difference between p, print and puts in ruby Difference between p, print and puts in ruby is something which a new ruby learner comes across with.