Skip to content

Commit

Permalink
Added documentation for Model.ns method
Browse files Browse the repository at this point in the history
  • Loading branch information
serebryakov committed May 28, 2010
1 parent 7181c8b commit 2639370
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/lib/model/base.rb
Expand Up @@ -56,8 +56,18 @@ def namespace(value = nil, options = {})
end end
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 def ns
@ns || 'myrdf' @ns.to_s || 'myrdf'
end end


## ##
Expand Down

0 comments on commit 2639370

Please sign in to comment.