Permalink
Browse files

Added documentation for Model.ns method

  • Loading branch information...
1 parent 7181c8b commit 2639370e85b12b8284321c08c8e1ab6c3526a265 @serebryakov serebryakov committed May 28, 2010
Showing with 11 additions and 1 deletion.
  1. +11 −1 lib/lib/model/base.rb
View
@@ -56,8 +56,18 @@ def namespace(value = nil, options = {})
end
end
+ ##
+ # Returns the short name for model's namespace. Defaults to `myrdf`
+ #
+ # class Person < RDFMapper::Model
+ # namespace 'http://example.org/schema#', :name => 'my'
+ # end
+ #
+ # Person.ns #=> 'example'
+ # Person.to_xml #=> '<my:Person></my:Person>'
+ ##
def ns
- @ns || 'myrdf'
+ @ns.to_s || 'myrdf'
end
##

0 comments on commit 2639370

Please sign in to comment.