Skip to content

Commit

Permalink
README more friendly with github
Browse files Browse the repository at this point in the history
  • Loading branch information
emerleite committed Nov 12, 2009
1 parent 94d0c87 commit 2b6f680
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,32 @@ The usuage is very straightforward. You only need to extend one module and use o

## Example

require 'demeter'
class Customer
attr_accessor :name
end

class Manager
attr_accessor :type
end

class Account
extend Demeter
attr_accessor :customer, :manager
demeter :customer, :manager
end

c = Customer.new
c.name = "Emerson"

m = Manager.new
m.type = "General"

a = Account.new
a.customer = c
a.manager = m
puts a.customer_name
puts a.manager_type
require 'demeter'
class Customer
attr_accessor :name
end
class Manager
attr_accessor :type
end
class Account
extend Demeter
attr_accessor :customer, :manager
demeter :customer, :manager
end
c = Customer.new
c.name = "Emerson"
m = Manager.new
m.type = "General"
a = Account.new
a.customer = c
a.manager = m
puts a.customer_name
puts a.manager_type

It should print "Emerson" at console
And should print "General" at console
Expand Down

0 comments on commit 2b6f680

Please sign in to comment.