1
<?xml version="1.0" encoding="utf-8"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
<title>Redland RDF Application Framework - Ruby RDoc - Class: Redland::World</title>
7
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
8
<script type="text/javascript">
11
function popupCode( url ) {
12
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
15
function toggleCode( id ) {
16
if ( document.getElementById )
17
elem = document.getElementById( id );
18
else if ( document.all )
19
elem = eval( "document.all." + id );
23
elemStyle = elem.style;
25
if ( elemStyle.display != "block" ) {
26
elemStyle.display = "block"
28
elemStyle.display = "none"
34
// Make codeblocks hidden by default
35
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }<\/style>" )
41
<div class="outerBlock">
43
<div class="outerHeader">
44
Go to <a href="/" target="_parent">Redland Home</a> -
45
<a href="/bindings/" target="_parent">Language Bindings Home</a> -
46
<a href="/docs/ruby.html" target="_parent">Ruby API Home</a>
49
<div id="classHeader">
50
<table class="header-table">
51
<tr class="top-aligned-row">
52
<td><strong>Class</strong></td>
53
<td class="class-name-in-header">Redland::World</td>
55
<tr class="top-aligned-row">
56
<td><strong>In:</strong></td>
57
<td><a href="../../files/rdf/redland_rb.html">rdf/redland.rb</a><br /></td>
59
<tr class="top-aligned-row">
60
<td><strong>Parent:</strong></td>
65
<!-- banner header -->
66
<div id="bodyContent">
67
<div id="contextContent">
68
<div id="description">
69
<p>The world object is the single global variable in <a href="../Redland.html">Redland</a> that all the classes, their factories and implementations reference.</p>
70
<p>In most programs there should be only one <a href="../Redland.html">Redland</a> world, using multiple models although multiple worlds are possible.</p>
73
<div id="method-list">
74
<h3 class="section-bar">Methods</h3>
75
<div class="name-list"><a href="#M000157">create_finalizer</a> <a href="#M000156">new</a> </div>
80
<div id="attribute-list">
81
<h3 class="section-bar">Attributes</h3>
82
<div class="name-list">
84
<tr class="top-aligned-row context-row">
85
<td class="context-item-name">world</td>
86
<td class="context-item-value"> [RW] </td>
87
<td class="context-item-desc">include Singleton</td>
92
<!-- if method_list -->
94
<h3 class="section-bar">Public Class methods</h3>
95
<div id="method-M000157" class="method-detail"><a name="M000157" id="M000157"></a>
96
<div class="method-heading"><a href="#M000157" class="method-signature"><span class="method-name">create_finalizer</span><span class="method-args">(world)</span></a></div>
97
<div class="method-description">
98
<p><a class="source-toggle" href="#" onclick="toggleCode('M000157-source');return false;">[Source]</a></p>
99
<div class="method-source-code" id="M000157-source">
101
<span class="ruby-comment cmt"># File rdf/redland.rb, line 54</span>
102
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">World</span>.<span class="ruby-identifier">create_finalizer</span>(<span class="ruby-identifier">world</span>)
103
<span class="ruby-identifier">proc</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">id</span><span class="ruby-operator">|</span> <span class="ruby-node">"Finalizer on #{id}"</span>
104
<span class="ruby-comment cmt">#log_final.info "closing world"</span>
105
<span class="ruby-comment cmt"># This is commented out because Ruby fails to guarantee this</span>
106
<span class="ruby-comment cmt"># is called after all other redland destructors</span>
107
<span class="ruby-comment cmt">#Redland::librdf_free_world world</span>
109
<span class="ruby-keyword kw">end</span>
113
<div id="method-M000156" class="method-detail"><a name="M000156" id="M000156"></a>
114
<div class="method-heading"><a href="#M000156" class="method-signature"><span class="method-name">new</span><span class="method-args">()</span></a></div>
115
<div class="method-description">
116
<p>Create <a href="World.html#M000156">new</a> RDF <a href="World.html">World</a> object (constructor)</p>
117
<p><a class="source-toggle" href="#" onclick="toggleCode('M000156-source');return false;">[Source]</a></p>
118
<div class="method-source-code" id="M000156-source">
120
<span class="ruby-comment cmt"># File rdf/redland.rb, line 48</span>
121
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>()
122
<span class="ruby-ivar">@world</span> = <span class="ruby-constant">Redland</span><span class="ruby-operator">::</span><span class="ruby-identifier">librdf_new_world</span>()
123
<span class="ruby-constant">Redland</span><span class="ruby-operator">::</span><span class="ruby-identifier">librdf_world_open</span>(<span class="ruby-ivar">@world</span>)
124
<span class="ruby-constant">ObjectSpace</span>.<span class="ruby-identifier">define_finalizer</span>(<span class="ruby-keyword kw">self</span>,<span class="ruby-constant">World</span>.<span class="ruby-identifier">create_finalizer</span>(<span class="ruby-ivar">@world</span>))
125
<span class="ruby-keyword kw">end</span>
133
<div class="outerHeader">
134
Go to <a href="/" target="_parent">Redland Home</a> -
135
<a href="/bindings/" target="_parent">Language Bindings Home</a> -
136
<a href="/docs/ruby.html" target="_parent">Ruby API Home</a>
139
<p>(C) Copyright 2004-2011 <a href="http://www.dajobe.org/" target="_parent">Dave Beckett</a>, (C) Copyright 2004-2005 <a href="http://www.bristol.ac.uk/" target="_parent">University of Bristol</a></p>
141
</div> <!-- end outerBlock -->