I am pasting the README for it over here:
Often when working with models that belong to an inheritance hierarchy,
it is useful to verify if a particular model is of a certain type to
perform some behavior specific to it. For example, this is needed when
the view needs to handle a special rendering case when encountering a
The call typically made to accomplish the task is:
Often, to do so in a more readable fashion, developers add a more
English-like method that hides the details of type checking:
Writing such methods gets repetitive after a while, so an easier way
to get these methods automatically is to mixin the EasilyTypable
When mixed into classes in an inheritance hierarchy, each class gets
"certain_type?" methods for its type and all of its subclass types.
require File.dirname(__FILE__) + '/../lib/easily_typable'
class TypeB < TypeA
class TypeC < TypeB
describe "Obtiva::EasilyTypable" do
it "should add type_a? method to TypeA object" do
it "should add type_b? method to TypeB object" do
it "should add type_b? method to TypeA object" do
it "should add type_c? method to TypeC object" do
it "should add type_c? method to TypeA object" do
it "should add type_c? method to TypeB object" do
Keep in mind that this is no substitute for good Object-Oriented design and is not an excuse to type-check everything in your code instead of letting behavior live in the models or rely on patterns like Strategy and State.
The type checking methods are simply useful in cases where type-related behavior really should not live on the model to maintain its cohesion and avoid strong coupling. An example of that is View logic that depends on the type of the model, but should not live in the model.