Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 567 Bytes

README.md

File metadata and controls

18 lines (11 loc) · 567 Bytes

Cygnet

cygnet is currently comprised of two parts:

  1. An implementation of the Null Object Pattern, which automatically accounts for nil.

  2. An implementation of collections.

Usage

$ rails c
[1] pry(main)> something = Cygnet::NullObject.new
=> <#Cygnet::NullObject ...>
[2] pry(main)> something.doesnotexist
=> <#Cygnet::NullObject ...>

[3] pry(main)> collection = Cygnet::PaginatedCollection.new(MyBuilderClass, [records, to, put, in, collection], {:page=>1, :per_page=>20})