Ruby 2 syntax

Let's use keyword arguments. It'll make things simpler when we add more
to the Jsonite.property declaration.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Remove unneeded parens

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add Jsonite.presents

Allows us to use Jsonite.present and hand it any registered resource to
be presented.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Unfocus spec

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Track property types when given

Allows for introspection (e.g., for documentation)

We could potentially warn if the value is of the wrong type during
presentation, but this causes complications for, e.g.,
Date/Time/DateTime.

Fixes #12

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add support for Jsonite(Resource)

It allows us to declare the presented resource class up front:

  class UserPresenter < Jsonite(User)
    property :name
  end
  Jsonite.present(User.first) # => {"name"=>"Stephen"}

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add mapping cache for resource subclass presentation

E.g.:

  class UserPresenter < Jsonite(User)
    property :name
  end

  class Admin < User
    # ...
  end

  Jsonite.present(Admin.first) # => {"name"=>"Stephen"}

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Just pass the resource through if no presenter subclass is found

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Document Jsonite() method

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Expose registered resource classes (for introspection)

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Don't bother converting strings

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Document property types

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Oops

I have no idea why this snuck in with the original Travis commit or what
my intentions for it were.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Spec for metadata

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add SLOC task

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Remove parens

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Jsonite.include_root_in_json support

Uses ActiveRecord's setting by default (if available).

Fixes #4

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add rehearsal to benchmark spec

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add resource classes to fixtures

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Better ignore support

Let's make it easier to ignore properties when they fulfill other
conditions, not necessarily just nil.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>