An experimental meta-mixin that adds the ability to describe a class’s structure in terms of RDF classes.
For more on how this is intended to work, see: deveiate.org/projects/Redleaf/wiki/Archetypes
*This module is not yet functional, and should not be distributed with releases, or counted on for its interface.*
require 'redleaf/archetypes' require 'redleaf/constants' class Project include Redleaf::Archetypes, Redleaf::Constants::CommonNamespaces include_archetype DOAP[:Project] end class Version include Redleaf::Archetypes, Redleaf::Constants::CommonNamespaces include_archetype DOAP[:Version] end class SVNRepository include Redleaf::Archetypes, Redleaf::Constants::CommonNamespaces include_archetype DOAP[:SVNRepository] end redleaf = Project.new( 'http://deveiate.org/projects/Redleaf' ) redleaf.created = Date.new( "2008-11-21" ) redleaf.license = URI( 'http://usefulinc.com/doap/licenses/asl20' ) redleaf.name = 'Redleaf' redleaf.homepage = URI( 'http://deveiate.org/projects/Redleaf' ) redleaf.shortdesc = 'An RDF library for Ruby' redleaf.description = <<-EOF Redleaf is an RDF library for Ruby. It's composed of a hand-written binding for the Redland RDF Library, and a high-level layer that adds some idioms that Rubyists might find familiar. EOF redleaf.bug_database = URI( "http://deveiate.org/projects/Redleaf/report" ) redleaf.download_page = URI( "http://deveiate.org/projects/Redleaf/wiki" ) redleaf.programming_language = [ 'Ruby', 'C' ] redleaf.category = 'library' version_0_0_1 = Version.new( :name => 'Maple', :created => Date.new('2008-12-01'), :revision => '0.0.1' ) redleaf.release = [ version_0_0_1 ] repo = SVNRepository.new( :location => URI('http://repo.deveiate.org/Redleaf'), :browse => URI('http://deveiate.org/projects/Redleaf/browser') ) redleaf.repository = [ repo ] redleaf.to_rdfxml
Inclusion callback — add the ability to declare Archetypes for the including Class or Module.
# File lib/redleaf/archetypes.rb, line 101 101: def self::included( mod ) 102: mod.extend( ClassMethods ) 103: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.