Tag Archives: Ruby

How to Write a Singleton Class in Ruby

A Singleton is a Design Pattern which is used to prevent a class from being instantiated more than once. So there can only be one object of that particular type of class. Writing a Singleton Class in Ruby is very easy and much more straight forward than doing it in Java, for example. It uses […]

Cheap Web Hosting for Rails Applications

If you want to host Ruby on Rails apps on a shared web hosting account and don’t want to spend too much money, consider using a web hosting company like BlueHost. Advantages of using BlueHost to host your Rails app BlueHost currently, as of September 6, 2009, provides the following services. BlueHost offers many more […]

Ruby Time formatting and datetime SQL Column

If you’d like to format Time in Ruby, keep in mind that datetime SQL Columns translate to Time objects. So you can use the strftime method of the Time class to format the date/time. For example, assume scheduled_time is a field in your database and it has a sql data type of ‘datetime’. In your […]