Sha256: e8b8d3cf09b5961a161994714eabf432819e3fc7fc8c7dfae3b7085552146f77

Contents?: true

Size: 618 Bytes

Versions: 1

Compression:

Stored size: 618 Bytes

Contents

# code:
# * George Moschovitis  <gm@navel.gr>
#
# (c) 2004 Navel, all rights reserved.
# $Id: entities.rb 118 2004-11-01 10:13:42Z gmosx $

module N

# gmosx: forward declaration, can we avoid this?
class Comment; end

# = Article
#
class Article
	prop_accessor String, :title
	prop_accessor String, :body
	prop_accessor Time, :create_time
	has_many N::Comment, :comments
	
	def initialize
		@create_time = Time.now
	end
end

# = Comment
#
class Comment
	prop_accessor String, :body
	prop_accessor Time, :create_time
	belongs_to N::Article, :article
	
	def initialize
		@create_time = Time.now
	end	
end

end # module

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nitro-0.3.0 examples/simple/lib/articles/entities.rb