Ruby Flay Gem – DRY code base

Tutorial will discuss Ruby Flay gem used to DRY up Ruby/Rails application. Flay gem enforces Best practices to be followed while coding with Ruby and Rails Flay gem Source: Flay on Github When to Use? - To make your codebase more DRY! Usage: 1) Install gem by - gem install flay 2) Process your files. […]

Resque Setup Development Mode

This tutorial will guide you setting up Resque locally in development mode with Multiple workers and how to use with Rails application to process background jobs. What is Resque? You might want to know what is Resque before we begin with commands/flow to set it up locally. It uses Redis as backend, thus you need […]

Memoization in Ruby

This tutorial will help you understanding Memoization pattern in Ruby. Memoization is different from Lazy Initialization. Rails had Memoize to support memoization pattern which will be discussed as well. What is Memoization? Memoization can be used to initialize a variable and store it with the result of some computation that is expected to give same result if computed […]

Integrate ActiveAdmin with Rails

This tutorial will help you integrating ActiveAdmin with Rails 4+ project. ActiveAdmin is open source administrative framework for Ruby on Rails. Source: Github Source Website: ActiveAdmin Website What is ActiveAdmin? As described ActiveAdmin is open source administrative framework that can be used with Rails framework. ActiveAdmin is helpful for content management by creating admin users. And giving them access to features […]

Difference between to_s and inspect in Ruby

to_s vs inspect

While running a script in Ruby, we usually want to log data from objects for debugging purpose. puts, p, logger methods are used to log along with to_s, inspect methods to log object. This tutorial will give brief about each method and when to use which one.   1. to_s to_s is very common method used by Ruby […]

Access specifiers in Ruby

This tutorial will discuss how to define Access specifiers in Ruby and what do they mean for classes and modules where they are being used. Default Scope Whenever you define a new method in any class/module the default access specifier that Ruby will use is public. Thus, all methods defined without any scope are public by […]