Skip to content

Commit

Permalink
added docs and, yeeeah, 1.0.0 release since we're stable. hooray!
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Dec 27, 2011
1 parent 5fa2e20 commit e07abbd
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES.textile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
h2. 1.0.0

* 1.0.0 release! Party time!

h2. 0.13.1

* Removed property :@name from @XML@ in favor of @:attribute => true@.
Expand Down
24 changes: 24 additions & 0 deletions lib/representable.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
require 'representable/definition'

# Representable can be used in two ways.
#
# == On class level
#
# To try out Representable you might include the format module into the represented class directly and then
# define the properties.
#
# class Hero < ActiveRecord::Base
# include Representable::JSON
# property :name
#
# This will give you to_/from_json for each instance. However, this approach limits your class to one representation.
#
# == On module level
#
# Modules give you much more flexibility since you can mix them into objects at runtime, roughly following the DCI
# pattern.
#
# module HeroRepresenter
# include Representable::JSON
# property :name
# end
#
# hero.extend(HeroRepresenter).to_json
module Representable
def self.included(base)
base.class_eval do
Expand Down
2 changes: 1 addition & 1 deletion lib/representable/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Representable
VERSION = "0.13.1"
VERSION = "1.0.0"
end

0 comments on commit e07abbd

Please sign in to comment.