RubyGems Navigation menu

easily_typable 1.0.1

Although polymorphism is a recommended standard in Object-Oriented programming for invoking varied behavior in an inheritance hierarchy, sometimes it is still useful to verify if a particular model belongs to a certain type when the behavior concerned does not belong to the model and is too small to require a Design Pattern like Strategy. To avoid the model.is_a?(CertainType) syntax, a more readable approach that developers resort to is to add an English-like method that hides the details of type checking model.certain_type?. Implementing such methods manually gets repetitive after a while, so an easier way to get these methods automatically is to mixin the EasilyTypable module.

Versions:

  1. 1.0.1 - February 08, 2017 (7.5 KB)
  2. 1.0.0 - February 07, 2017 (7 KB)

Authors:

  • AndyObtiva

Owners:

F16825b6fdbeb91bae58f67ee6ec5a82

SHA 256 checksum:

215c3bc3396f09c9894855e3053e83122a8f6f10ab2462879fd4103587d0abdf

Total downloads 693

For this version 408

Gemfile:
= Copy to clipboard Copied!

install:
=

License:

MIT

Required Ruby Version: >= 0

Links: