Home
Pushpa Raj Badu
Cancel

filter empty element from an array

In this post we will see how we can filter array of element without empty element which can be null or '' Using javascript Javascript .filter() method creates a new array with all elements that p...

ruby safe navigation operator (&.)

This post you will learn about the most interesting addition to Ruby 2.3.0, the Safe Navigation Operator(&.). Scenario Lets say we have a cart object, which belongs to an owner and we want to...

convert deeply nested JSON into OpenStruct object

This post will help you convert JSON objects into an OpenStruct object, which will allow us to extract value directly using . dot notation e.g: json_result.key If you are using with any JSON API s...

Use dig method to get value from deeply nested key

Learn how to extracts the nested value specified by the sequence of key objects by calling dig at each step, returning nil if any intermediate step is nil. Example data Lets say we have following...

Rails Notes Explained

In this post you will learn how to list down all of your todos, fixme, optimize tags from the rails project. In your rails project if you run rake notes (you can also use rails notes in rails 5+ ...

Ruby merge Vs deep_merge

This post will help you understand the difference between Ruby’s merge and Rails deep_merge method. Merge Ruby’s merge method merges one hash into another, as it’s name suggest { first_name: 'Jo...