Feature::RequireAttr

Simple class attribute validation

Overview

require "feature/require_attr"

class Person
  def format
    require_attr :name, not_to_be: :empty
    require_attr :age, to_be_a: Fixnum
    require_attr :jobs, to_respond_to: :each

    ...
  end
end

Full documentation is available at rubydoc.info.

Setup

This project is a sub. Sub setup example is available here.

For more info on subs, click here.

Cheers!

— Alex Fortuna, © 2015