Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

first commit

  • Loading branch information...
commit 1efa43dbcace361216220a86d3901c677a4c7044 0 parents
@fabrik42 authored
Showing with 3,216 additions and 0 deletions.
  1. +1 −0  .gitignore
  2. +4 −0 History.txt
  3. +16 −0 Manifest.txt
  4. +7 −0 PostInstall.txt
  5. +49 −0 README.rdoc
  6. +28 −0 Rakefile
  7. +158 −0 doc/classes/ActsAsApi.html
  8. +196 −0 doc/classes/ActsAsApi/Base.html
  9. +174 −0 doc/classes/ActsAsApi/Base/ClassMethods.html
  10. +204 −0 doc/classes/ActsAsApi/Base/InstanceMethods.html
  11. +180 −0 doc/classes/ActsAsApi/Rendering.html
  12. +175 −0 doc/classes/Array.html
  13. +1 −0  doc/created.rid
  14. +115 −0 doc/files/History_txt.html
  15. +111 −0 doc/files/Manifest_txt.html
  16. +112 −0 doc/files/PostInstall_txt.html
  17. +108 −0 doc/files/lib/acts_as_api/array_rb.html
  18. +101 −0 doc/files/lib/acts_as_api/base_rb.html
  19. +101 −0 doc/files/lib/acts_as_api/rendering_rb.html
  20. +111 −0 doc/files/lib/acts_as_api_rb.html
  21. +32 −0 doc/fr_class_index.html
  22. +33 −0 doc/fr_file_index.html
  23. +33 −0 doc/fr_method_index.html
  24. +24 −0 doc/index.html
  25. +208 −0 doc/rdoc-style.css
  26. +35 −0 lib/acts_as_api.rb
  27. +25 −0 lib/acts_as_api/array.rb
  28. +115 −0 lib/acts_as_api/base.rb
  29. +43 −0 lib/acts_as_api/rendering.rb
  30. BIN  pkg/acts_as_api-0.0.1.gem
  31. BIN  pkg/acts_as_api-0.0.1.tgz
  32. +4 −0 pkg/acts_as_api-0.0.1/History.txt
  33. +16 −0 pkg/acts_as_api-0.0.1/Manifest.txt
  34. +7 −0 pkg/acts_as_api-0.0.1/PostInstall.txt
  35. +49 −0 pkg/acts_as_api-0.0.1/README.rdoc
  36. +28 −0 pkg/acts_as_api-0.0.1/Rakefile
  37. +35 −0 pkg/acts_as_api-0.0.1/lib/acts_as_api.rb
  38. +25 −0 pkg/acts_as_api-0.0.1/lib/acts_as_api/array.rb
  39. +115 −0 pkg/acts_as_api-0.0.1/lib/acts_as_api/base.rb
  40. +43 −0 pkg/acts_as_api-0.0.1/lib/acts_as_api/rendering.rb
  41. +10 −0 pkg/acts_as_api-0.0.1/script/console
  42. +14 −0 pkg/acts_as_api-0.0.1/script/destroy
  43. +14 −0 pkg/acts_as_api-0.0.1/script/generate
  44. +87 −0 pkg/acts_as_api-0.0.1/spec/acts_as_api_spec.rb
  45. +1 −0  pkg/acts_as_api-0.0.1/spec/spec.opts
  46. +18 −0 pkg/acts_as_api-0.0.1/spec/spec_helper.rb
  47. +21 −0 pkg/acts_as_api-0.0.1/tasks/rspec.rake
  48. +10 −0 script/console
  49. +14 −0 script/destroy
  50. +14 −0 script/generate
  51. +87 −0 spec/acts_as_api_spec.rb
  52. +1 −0  spec/spec.opts
  53. +18 −0 spec/spec_helper.rb
  54. +64 −0 spec/spec_models.rb
  55. +21 −0 tasks/rspec.rake
1  .gitignore
@@ -0,0 +1 @@
+nbproject/
4 History.txt
@@ -0,0 +1,4 @@
+=== 0.0.1 2010-06-27
+
+* 1 major enhancement:
+ * Initial release
16 Manifest.txt
@@ -0,0 +1,16 @@
+README.rdoc
+History.txt
+Manifest.txt
+PostInstall.txt
+Rakefile
+lib/acts_as_api.rb
+lib/acts_as_api/array.rb
+lib/acts_as_api/base.rb
+lib/acts_as_api/rendering.rb
+script/console
+script/destroy
+script/generate
+spec/acts_as_api_spec.rb
+spec/spec.opts
+spec/spec_helper.rb
+tasks/rspec.rake
7 PostInstall.txt
@@ -0,0 +1,7 @@
+
+For more information on acts_as_api, see http://acts_as_api.rubyforge.org
+
+NOTE: Change this information in PostInstall.txt
+You can also delete it if you don't want it.
+
+
49 README.rdoc
@@ -0,0 +1,49 @@
+= acts_as_api
+
+* http://github.com/ffwdme/acts_as_api
+
+
+== DESCRIPTION:
+
+acts_as_api makes creating XML/JSON responses in Rails 3 easy and fun.
+
+== FEATURES/PROBLEMS:
+
+* FIX (list of features or problems)
+
+== SYNOPSIS:
+
+ See example app :)
+
+== REQUIREMENTS:
+
+* Rails 3 beta 4
+
+== INSTALL:
+
+ sudo gem install acts_as_api
+
+== LICENSE:
+
+(The MIT License)
+
+Copyright (c) 2010 FIXME full name
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 Rakefile
@@ -0,0 +1,28 @@
+require 'rubygems'
+gem 'hoe', '>= 2.1.0'
+require 'hoe'
+require 'fileutils'
+require './lib/acts_as_api'
+
+Hoe.plugin :newgem
+# Hoe.plugin :website
+# Hoe.plugin :cucumberfeatures
+
+# Generate all the Rake tasks
+# Run 'rake -T' to see list of generated tasks (from gem root directory)
+$hoe = Hoe.spec 'acts_as_api' do
+ self.developer 'Christian Bäuerlein', 'christian@ffwdme.com'
+ #self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
+ #self.rubyforge_name = self.name # TODO this is default value
+ self.extra_deps = [['activerecord','>= 3.0.0.beta4'], ['actionpack','>= 3.0.0.beta4']]
+
+end
+
+require 'newgem/tasks'
+# In Netbeans the next lines causes every rspec test to run twice.
+# If you're not using Netbeans and having problem with testing - try to disable it.
+#Dir['tasks/**/*.rake'].each { |t| load t }
+
+# TODO - want other tests/tasks run by default? Add them to the list
+# remove_task :default
+# task :default => [:spec, :features]
158 doc/classes/ActsAsApi.html
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Module: ActsAsApi</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="classHeader">
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Module</strong></td>
+ <td class="class-name-in-header">ActsAsApi</td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>In:</strong></td>
+ <td>
+ <a href="../files/lib/acts_as_api/base_rb.html">
+ lib/acts_as_api/base.rb
+ </a>
+ <br />
+ <a href="../files/lib/acts_as_api/rendering_rb.html">
+ lib/acts_as_api/rendering.rb
+ </a>
+ <br />
+ <a href="../files/lib/acts_as_api_rb.html">
+ lib/acts_as_api.rb
+ </a>
+ <br />
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+acts_as_api is a gem that aims to make the construction of JSON and XML
+responses in rails 3 easy and fun.
+</p>
+<p>
+Therefore it attaches a couple of helper methods to active record and the
+action controller base classes.
+</p>
+<p>
+acts_as_api uses the default serializers of your rails app and
+doesn&#8216;t force you into more dependencies.
+</p>
+
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+ <div id="class-list">
+ <h3 class="section-bar">Classes and Modules</h3>
+
+ Module <a href="ActsAsApi/Base.html" class="link">ActsAsApi::Base</a><br />
+Module <a href="ActsAsApi/Rendering.html" class="link">ActsAsApi::Rendering</a><br />
+
+ </div>
+
+ <div id="constants-list">
+ <h3 class="section-bar">Constants</h3>
+
+ <div class="name-list">
+ <table summary="Constants">
+ <tr class="top-aligned-row context-row">
+ <td class="context-item-name">VERSION</td>
+ <td>=</td>
+ <td class="context-item-value">'0.0.1'</td>
+ </tr>
+ <tr class="top-aligned-row context-row">
+ <td class="context-item-name">ACCEPTED_API_FORMATS</td>
+ <td>=</td>
+ <td class="context-item-value">[:xml, :json]</td>
+ <td width="3em">&nbsp;</td>
+ <td class="context-item-desc">
+The accepted response formats Default is +[:xml, :json]+
+
+</td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+
+
+
+
+
+ <!-- if method_list -->
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
196 doc/classes/ActsAsApi/Base.html
@@ -0,0 +1,196 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Module: ActsAsApi::Base</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="classHeader">
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Module</strong></td>
+ <td class="class-name-in-header">ActsAsApi::Base</td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>In:</strong></td>
+ <td>
+ <a href="../../files/lib/acts_as_api/base_rb.html">
+ lib/acts_as_api/base.rb
+ </a>
+ <br />
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+This module enriches the ActiveRecord::Base module of Rails.
+</p>
+
+ </div>
+
+
+ </div>
+
+ <div id="method-list">
+ <h3 class="section-bar">Methods</h3>
+
+ <div class="name-list">
+ <a href="#M000004">acts_as_api</a>&nbsp;&nbsp;
+ <a href="#M000003">acts_as_api?</a>&nbsp;&nbsp;
+ </div>
+ </div>
+
+ </div>
+
+
+ <!-- if includes -->
+ <div id="includes">
+ <h3 class="section-bar">Included Modules</h3>
+
+ <div id="includes-list">
+ <span class="include-name"><a href="Base/InstanceMethods.html">ActsAsApi::Base::InstanceMethods</a></span>
+ </div>
+ </div>
+
+ <div id="section">
+
+ <div id="class-list">
+ <h3 class="section-bar">Classes and Modules</h3>
+
+ Module <a href="Base/ClassMethods.html" class="link">ActsAsApi::Base::ClassMethods</a><br />
+Module <a href="Base/InstanceMethods.html" class="link">ActsAsApi::Base::InstanceMethods</a><br />
+
+ </div>
+
+
+
+
+
+
+
+ <!-- if method_list -->
+ <div id="methods">
+ <h3 class="section-bar">Public Instance methods</h3>
+
+ <div id="method-M000004" class="method-detail">
+ <a name="M000004"></a>
+
+ <div class="method-heading">
+ <a href="#M000004" class="method-signature">
+ <span class="method-name">acts_as_api</span><span class="method-args">()</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p>
+When invoked, it enriches the current model with the class and instance
+methods to act as api.
+</p>
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000004-source">
+<pre>
+<span class="ruby-comment cmt"># File lib/acts_as_api/base.rb, line 12</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">acts_as_api</span>
+
+ <span class="ruby-identifier">class_eval</span> <span class="ruby-keyword kw">do</span>
+ <span class="ruby-identifier">include</span> <span class="ruby-constant">ActsAsApi</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span><span class="ruby-operator">::</span><span class="ruby-constant">InstanceMethods</span>
+ <span class="ruby-identifier">extend</span> <span class="ruby-constant">ActsAsApi</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span><span class="ruby-operator">::</span><span class="ruby-constant">ClassMethods</span>
+ <span class="ruby-keyword kw">end</span>
+
+ <span class="ruby-keyword kw">end</span>
+</pre>
+ </div>
+ </div>
+ </div>
+
+ <div id="method-M000003" class="method-detail">
+ <a name="M000003"></a>
+
+ <div class="method-heading">
+ <a href="#M000003" class="method-signature">
+ <span class="method-name">acts_as_api?</span><span class="method-args">()</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p>
+Indicates if the current model acts as api. False by default.
+</p>
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000003-source">
+<pre>
+<span class="ruby-comment cmt"># File lib/acts_as_api/base.rb, line 6</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">acts_as_api?</span>
+ <span class="ruby-keyword kw">false</span>
+ <span class="ruby-keyword kw">end</span>
+</pre>
+ </div>
+ </div>
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
174 doc/classes/ActsAsApi/Base/ClassMethods.html
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Module: ActsAsApi::Base::ClassMethods</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="classHeader">
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Module</strong></td>
+ <td class="class-name-in-header">ActsAsApi::Base::ClassMethods</td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>In:</strong></td>
+ <td>
+ <a href="../../../files/lib/acts_as_api/base_rb.html">
+ lib/acts_as_api/base.rb
+ </a>
+ <br />
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+
+
+ </div>
+
+ <div id="method-list">
+ <h3 class="section-bar">Methods</h3>
+
+ <div class="name-list">
+ <a href="#M000005">api_accessible</a>&nbsp;&nbsp;
+ <a href="#M000006">api_accessible_attributes</a>&nbsp;&nbsp;
+ </div>
+ </div>
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+ <div id="methods">
+ <h3 class="section-bar">Public Instance methods</h3>
+
+ <div id="method-M000005" class="method-detail">
+ <a name="M000005"></a>
+
+ <div class="method-heading">
+ <a href="#M000005" class="method-signature">
+ <span class="method-name">api_accessible</span><span class="method-args">(*attributes)</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p>
+Determines the attributes, methods of the model that are accessible in the
+api response. <b>Note</b>: There is only whitelisting for api accessible
+attributes. So once the model acts as api, you have to determine all
+attributes here that should be contained in the api responses.
+</p>
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000005-source">
+<pre>
+<span class="ruby-comment cmt"># File lib/acts_as_api/base.rb, line 31</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">api_accessible</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">attributes</span>)
+ <span class="ruby-identifier">write_inheritable_attribute</span>(<span class="ruby-identifier">:api_accessible</span>, <span class="ruby-constant">Set</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">attributes</span>) <span class="ruby-operator">+</span> (<span class="ruby-identifier">api_accessible_attributes</span> <span class="ruby-operator">||</span> []))
+ <span class="ruby-keyword kw">end</span>
+</pre>
+ </div>
+ </div>
+ </div>
+
+ <div id="method-M000006" class="method-detail">
+ <a name="M000006"></a>
+
+ <div class="method-heading">
+ <a href="#M000006" class="method-signature">
+ <span class="method-name">api_accessible_attributes</span><span class="method-args">()</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p>
+Returns an array of all the attributes that have been made accessible to
+the api response.
+</p>
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000006-source">
+<pre>
+<span class="ruby-comment cmt"># File lib/acts_as_api/base.rb, line 36</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">api_accessible_attributes</span>
+ <span class="ruby-identifier">read_inheritable_attribute</span>(<span class="ruby-identifier">:api_accessible</span>)
+ <span class="ruby-keyword kw">end</span>
+</pre>
+ </div>
+ </div>
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
204 doc/classes/ActsAsApi/Base/InstanceMethods.html
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Module: ActsAsApi::Base::InstanceMethods</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="classHeader">
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Module</strong></td>
+ <td class="class-name-in-header">ActsAsApi::Base::InstanceMethods</td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>In:</strong></td>
+ <td>
+ <a href="../../../files/lib/acts_as_api/base_rb.html">
+ lib/acts_as_api/base.rb
+ </a>
+ <br />
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+
+
+ </div>
+
+ <div id="method-list">
+ <h3 class="section-bar">Methods</h3>
+
+ <div class="name-list">
+ <a href="#M000007">as_api_response</a>&nbsp;&nbsp;
+ </div>
+ </div>
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+ <div id="methods">
+ <h3 class="section-bar">Public Instance methods</h3>
+
+ <div id="method-M000007" class="method-detail">
+ <a name="M000007"></a>
+
+ <div class="method-heading">
+ <a href="#M000007" class="method-signature">
+ <span class="method-name">as_api_response</span><span class="method-args">()</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p>
+Creates the api response of the model and returns it as a Hash.
+</p>
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000007-source">
+<pre>
+<span class="ruby-comment cmt"># File lib/acts_as_api/base.rb, line 46</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">as_api_response</span>
+ <span class="ruby-identifier">api_attributes</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">api_accessible_attributes</span>
+
+ <span class="ruby-identifier">api_output</span> = {}
+
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">api_output</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">api_attributes</span>.<span class="ruby-identifier">nil?</span>
+
+ <span class="ruby-identifier">api_attributes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">attribute</span><span class="ruby-operator">|</span>
+
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">attribute</span>
+ <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Symbol</span>
+
+ <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">attribute</span>)
+ <span class="ruby-identifier">out</span> = <span class="ruby-identifier">send</span> <span class="ruby-identifier">attribute</span>
+
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">out</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:as_api_response</span>)
+ <span class="ruby-identifier">out</span> = <span class="ruby-identifier">out</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:as_api_response</span>)
+ <span class="ruby-keyword kw">end</span>
+
+ <span class="ruby-identifier">api_output</span>[<span class="ruby-identifier">attribute</span>] = <span class="ruby-identifier">out</span>
+
+ <span class="ruby-keyword kw">end</span>
+
+ <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Hash</span>
+
+ <span class="ruby-identifier">queue</span> = []
+ <span class="ruby-identifier">queue</span> <span class="ruby-operator">&lt;&lt;</span> { <span class="ruby-identifier">:parent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">api_output</span>, <span class="ruby-identifier">:item</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">attribute</span>}
+
+ <span class="ruby-keyword kw">until</span> <span class="ruby-identifier">queue</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-keyword kw">do</span>
+
+ <span class="ruby-identifier">leaf</span> = <span class="ruby-identifier">queue</span>.<span class="ruby-identifier">pop</span>
+
+ <span class="ruby-identifier">leaf</span>[<span class="ruby-identifier">:item</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
+
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">v</span>
+ <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Symbol</span>
+
+ <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">v</span>)
+ <span class="ruby-identifier">out</span> = <span class="ruby-identifier">send</span> <span class="ruby-identifier">v</span>
+
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">out</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:as_api_response</span>)
+ <span class="ruby-identifier">out</span> = <span class="ruby-identifier">out</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:as_api_response</span>)
+ <span class="ruby-keyword kw">end</span>
+
+ <span class="ruby-identifier">leaf</span>[<span class="ruby-identifier">:parent</span>][<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">out</span>
+
+ <span class="ruby-keyword kw">end</span>
+
+ <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Hash</span>
+ <span class="ruby-identifier">leaf</span>[<span class="ruby-identifier">:parent</span>][<span class="ruby-identifier">k</span>] <span class="ruby-operator">||=</span> {}
+ <span class="ruby-identifier">queue</span> <span class="ruby-operator">&lt;&lt;</span> { <span class="ruby-identifier">:parent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">leaf</span>[<span class="ruby-identifier">:parent</span>][<span class="ruby-identifier">k</span>], <span class="ruby-identifier">:item</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">v</span>}
+ <span class="ruby-keyword kw">end</span>
+
+ <span class="ruby-keyword kw">end</span>
+
+ <span class="ruby-keyword kw">end</span>
+
+ <span class="ruby-keyword kw">end</span>
+
+ <span class="ruby-keyword kw">end</span>
+
+ <span class="ruby-identifier">api_output</span>
+
+ <span class="ruby-keyword kw">end</span>
+</pre>
+ </div>
+ </div>
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
180 doc/classes/ActsAsApi/Rendering.html
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Module: ActsAsApi::Rendering</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="classHeader">
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Module</strong></td>
+ <td class="class-name-in-header">ActsAsApi::Rendering</td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>In:</strong></td>
+ <td>
+ <a href="../../files/lib/acts_as_api/rendering_rb.html">
+ lib/acts_as_api/rendering.rb
+ </a>
+ <br />
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+The methods of this module are included into the
+AbstractController::Rendering module.
+</p>
+
+ </div>
+
+
+ </div>
+
+ <div id="method-list">
+ <h3 class="section-bar">Methods</h3>
+
+ <div class="name-list">
+ <a href="#M000002">render_for_api</a>&nbsp;&nbsp;
+ </div>
+ </div>
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+ <div id="methods">
+ <h3 class="section-bar">Public Instance methods</h3>
+
+ <div id="method-M000002" class="method-detail">
+ <a name="M000002"></a>
+
+ <div class="method-heading">
+ <a href="#M000002" class="method-signature">
+ <span class="method-name">render_for_api</span><span class="method-args">(render_options)</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p>
+Provides an alternative to the <tt>render</tt> method used within the
+controller to simply generate API outputs.
+</p>
+<p>
+The default Rails serializers are used to serialize the data.
+</p>
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000002-source">
+<pre>
+<span class="ruby-comment cmt"># File lib/acts_as_api/rendering.rb, line 11</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_for_api</span>(<span class="ruby-identifier">render_options</span>)
+
+ <span class="ruby-comment cmt"># extract the api format and model</span>
+ <span class="ruby-identifier">api_format_options</span> = {}
+
+ <span class="ruby-constant">ActsAsApi</span><span class="ruby-operator">::</span><span class="ruby-constant">ACCEPTED_API_FORMATS</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">render_options</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">item</span>)
+ <span class="ruby-identifier">api_format_options</span>[<span class="ruby-identifier">item</span>] = <span class="ruby-identifier">render_options</span>[<span class="ruby-identifier">item</span>]
+ <span class="ruby-identifier">render_options</span>.<span class="ruby-identifier">delete</span> <span class="ruby-identifier">item</span>
+ <span class="ruby-keyword kw">end</span>
+ <span class="ruby-keyword kw">end</span>
+
+
+ <span class="ruby-identifier">api_format</span> = <span class="ruby-identifier">api_format_options</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">first</span>
+ <span class="ruby-identifier">api_model</span> = <span class="ruby-identifier">api_format_options</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">first</span>
+
+ <span class="ruby-comment cmt"># set the params to render</span>
+ <span class="ruby-identifier">output_params</span> = <span class="ruby-identifier">render_options</span>
+
+ <span class="ruby-comment cmt"># set the name of the root node - pluralize for arrays</span>
+ <span class="ruby-identifier">api_root_name</span> = <span class="ruby-identifier">api_model</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">api_model</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">downcase</span>.<span class="ruby-identifier">pluralize</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">api_model</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">downcase</span>
+ <span class="ruby-identifier">output_params</span>[<span class="ruby-identifier">:root</span>] = <span class="ruby-identifier">api_root_name</span>
+
+ <span class="ruby-comment cmt"># create the Hash as response</span>
+ <span class="ruby-identifier">output_params</span>[<span class="ruby-identifier">api_format</span>] = <span class="ruby-identifier">api_model</span>.<span class="ruby-identifier">as_api_response</span>
+
+ <span class="ruby-identifier">render</span> <span class="ruby-identifier">output_params</span>
+
+ <span class="ruby-keyword kw">end</span>
+</pre>
+ </div>
+ </div>
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
175 doc/classes/Array.html
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Class: Array</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="classHeader">
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Class</strong></td>
+ <td class="class-name-in-header">Array</td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>In:</strong></td>
+ <td>
+ <a href="../files/lib/acts_as_api/array_rb.html">
+ lib/acts_as_api/array.rb
+ </a>
+ <br />
+ </td>
+ </tr>
+
+ <tr class="top-aligned-row">
+ <td><strong>Parent:</strong></td>
+ <td>
+ Object
+ </td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+The standard ruby <a href="Array.html">Array</a> class is extended by one
+method.
+</p>
+
+ </div>
+
+
+ </div>
+
+ <div id="method-list">
+ <h3 class="section-bar">Methods</h3>
+
+ <div class="name-list">
+ <a href="#M000001">as_api_response</a>&nbsp;&nbsp;
+ </div>
+ </div>
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+ <div id="methods">
+ <h3 class="section-bar">Public Instance methods</h3>
+
+ <div id="method-M000001" class="method-detail">
+ <a name="M000001"></a>
+
+ <div class="method-heading">
+ <a href="#M000001" class="method-signature">
+ <span class="method-name">as_api_response</span><span class="method-args">()</span>
+ </a>
+ </div>
+
+ <div class="method-description">
+ <p>
+Neccessary to render an <a href="Array.html">Array</a> of models, e.g. the
+result of a search.
+</p>
+<p>
+The <a href="Array.html">Array</a> checks all its items if they respond to
+the <tt><a href="Array.html#M000001">as_api_response</a></tt> method. If
+they do, the result of this method will be collected. If they don&#8216;t,
+the item itself will be collected.
+</p>
+ <p><a class="source-toggle" href="#"
+ onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
+ <div class="method-source-code" id="M000001-source">
+<pre>
+<span class="ruby-comment cmt"># File lib/acts_as_api/array.rb, line 9</span>
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">as_api_response</span>
+
+ <span class="ruby-identifier">sub_items</span> = []
+
+ <span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:as_api_response</span>)
+ <span class="ruby-identifier">sub_items</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">as_api_response</span>
+ <span class="ruby-keyword kw">else</span>
+ <span class="ruby-identifier">sub_items</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">item</span>
+ <span class="ruby-keyword kw">end</span>
+ <span class="ruby-keyword kw">end</span>
+
+ <span class="ruby-identifier">sub_items</span>
+
+ <span class="ruby-keyword kw">end</span>
+</pre>
+ </div>
+ </div>
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
1  doc/created.rid
@@ -0,0 +1 @@
+Tue, 29 Jun 2010 16:12:19 +0200
115 doc/files/History_txt.html
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>File: History.txt</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="fileHeader">
+ <h1>History.txt</h1>
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Path:</strong></td>
+ <td>History.txt
+ </td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>Last Update:</strong></td>
+ <td>Sun Jun 27 13:00:51 +0200 2010</td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <h3>0.0.1 2010-06-27</h3>
+<ul>
+<li>1 major enhancement:
+
+<ul>
+<li>Initial release
+
+</li>
+</ul>
+</li>
+</ul>
+
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
111 doc/files/Manifest_txt.html
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>File: Manifest.txt</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="fileHeader">
+ <h1>Manifest.txt</h1>
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Path:</strong></td>
+ <td>Manifest.txt
+ </td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>Last Update:</strong></td>
+ <td>Tue Jun 29 16:12:16 +0200 2010</td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+README.rdoc History.txt Manifest.txt PostInstall.txt Rakefile
+lib/acts_as_api.rb lib/acts_as_api/array.rb lib/acts_as_api/base.rb
+lib/acts_as_api/rendering.rb script/console script/destroy script/generate
+spec/acts_as_api_spec.rb spec/spec.opts spec/spec_helper.rb
+tasks/rspec.rake
+</p>
+
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
112 doc/files/PostInstall_txt.html
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>File: PostInstall.txt</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="fileHeader">
+ <h1>PostInstall.txt</h1>
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Path:</strong></td>
+ <td>PostInstall.txt
+ </td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>Last Update:</strong></td>
+ <td>Sun Jun 27 13:00:51 +0200 2010</td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+For more information on acts_as_api, see <a
+href="http://acts_as_api.rubyforge.org">acts_as_api.rubyforge.org</a>
+</p>
+<p>
+NOTE: Change this information in PostInstall.txt You can also delete it if
+you don&#8216;t want it.
+</p>
+
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
108 doc/files/lib/acts_as_api/array_rb.html
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>File: array.rb</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="fileHeader">
+ <h1>array.rb</h1>
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Path:</strong></td>
+ <td>lib/acts_as_api/array.rb
+ </td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>Last Update:</strong></td>
+ <td>Mon Jun 28 19:20:20 +0200 2010</td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+ <div id="description">
+ <p>
+The standard ruby <a href="../../../classes/Array.html">Array</a> class is
+extended by one method.
+</p>
+
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
101 doc/files/lib/acts_as_api/base_rb.html
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>File: base.rb</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="fileHeader">
+ <h1>base.rb</h1>
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Path:</strong></td>
+ <td>lib/acts_as_api/base.rb
+ </td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>Last Update:</strong></td>
+ <td>Mon Jun 28 19:30:18 +0200 2010</td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+
+
+ </div>
+
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
101 doc/files/lib/acts_as_api/rendering_rb.html
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>File: rendering.rb</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="fileHeader">
+ <h1>rendering.rb</h1>
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Path:</strong></td>
+ <td>lib/acts_as_api/rendering.rb
+ </td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>Last Update:</strong></td>
+ <td>Mon Jun 28 21:55:45 +0200 2010</td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+
+
+ </div>
+
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
111 doc/files/lib/acts_as_api_rb.html
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>File: acts_as_api.rb</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
+ <script type="text/javascript">
+ // <![CDATA[
+
+ function popupCode( url ) {
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+ }
+
+ function toggleCode( id ) {
+ if ( document.getElementById )
+ elem = document.getElementById( id );
+ else if ( document.all )
+ elem = eval( "document.all." + id );
+ else
+ return false;
+
+ elemStyle = elem.style;
+
+ if ( elemStyle.display != "block" ) {
+ elemStyle.display = "block"
+ } else {
+ elemStyle.display = "none"
+ }
+
+ return true;
+ }
+
+ // Make codeblocks hidden by default
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+
+ // ]]>
+ </script>
+
+</head>
+<body>
+
+
+
+ <div id="fileHeader">
+ <h1>acts_as_api.rb</h1>
+ <table class="header-table">
+ <tr class="top-aligned-row">
+ <td><strong>Path:</strong></td>
+ <td>lib/acts_as_api.rb
+ </td>
+ </tr>
+ <tr class="top-aligned-row">
+ <td><strong>Last Update:</strong></td>
+ <td>Mon Jun 28 22:01:53 +0200 2010</td>
+ </tr>
+ </table>
+ </div>
+ <!-- banner header -->
+
+ <div id="bodyContent">
+
+
+
+ <div id="contextContent">
+
+
+ <div id="requires-list">
+ <h3 class="section-bar">Required files</h3>
+
+ <div class="name-list">
+ rubygems&nbsp;&nbsp;
+ acts_as_api/base&nbsp;&nbsp;
+ acts_as_api/rendering&nbsp;&nbsp;
+ acts_as_api/array&nbsp;&nbsp;
+ </div>
+ </div>
+
+ </div>
+
+
+ </div>
+
+
+ <!-- if includes -->
+
+ <div id="section">
+
+
+
+
+
+
+
+
+ <!-- if method_list -->
+
+
+ </div>
+
+
+<div id="validator-badges">
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
32 doc/fr_class_index.html
@@ -0,0 +1,32 @@
+
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<!--
+
+ Classes
+
+ -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Classes</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
+ <base target="docwin" />
+</head>
+<body>
+<div id="index">
+ <h1 class="section-bar">Classes</h1>
+ <div id="index-entries">
+ <a href="classes/ActsAsApi.html">ActsAsApi</a><br />
+ <a href="classes/ActsAsApi/Base.html">ActsAsApi::Base</a><br />
+ <a href="classes/ActsAsApi/Base/ClassMethods.html">ActsAsApi::Base::ClassMethods</a><br />
+ <a href="classes/ActsAsApi/Base/InstanceMethods.html">ActsAsApi::Base::InstanceMethods</a><br />
+ <a href="classes/ActsAsApi/Rendering.html">ActsAsApi::Rendering</a><br />
+ <a href="classes/Array.html">Array</a><br />
+ </div>
+</div>
+</body>
+</html>
33 doc/fr_file_index.html
@@ -0,0 +1,33 @@
+
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<!--
+
+ Files
+
+ -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Files</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
+ <base target="docwin" />
+</head>
+<body>
+<div id="index">
+ <h1 class="section-bar">Files</h1>
+ <div id="index-entries">
+ <a href="files/History_txt.html">History.txt</a><br />
+ <a href="files/Manifest_txt.html">Manifest.txt</a><br />
+ <a href="files/PostInstall_txt.html">PostInstall.txt</a><br />
+ <a href="files/lib/acts_as_api_rb.html">lib/acts_as_api.rb</a><br />
+ <a href="files/lib/acts_as_api/array_rb.html">lib/acts_as_api/array.rb</a><br />
+ <a href="files/lib/acts_as_api/base_rb.html">lib/acts_as_api/base.rb</a><br />
+ <a href="files/lib/acts_as_api/rendering_rb.html">lib/acts_as_api/rendering.rb</a><br />
+ </div>
+</div>
+</body>
+</html>
33 doc/fr_method_index.html
@@ -0,0 +1,33 @@
+
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<!--
+
+ Methods
+
+ -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Methods</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <link rel="stylesheet" href="rdoc-style.css" type="text/css" />
+ <base target="docwin" />
+</head>
+<body>
+<div id="index">
+ <h1 class="section-bar">Methods</h1>
+ <div id="index-entries">
+ <a href="classes/ActsAsApi/Base.html#M000004">acts_as_api (ActsAsApi::Base)</a><br />
+ <a href="classes/ActsAsApi/Base.html#M000003">acts_as_api? (ActsAsApi::Base)</a><br />
+ <a href="classes/ActsAsApi/Base/ClassMethods.html#M000005">api_accessible (ActsAsApi::Base::ClassMethods)</a><br />
+ <a href="classes/ActsAsApi/Base/ClassMethods.html#M000006">api_accessible_attributes (ActsAsApi::Base::ClassMethods)</a><br />
+ <a href="classes/Array.html#M000001">as_api_response (Array)</a><br />
+ <a href="classes/ActsAsApi/Base/InstanceMethods.html#M000007">as_api_response (ActsAsApi::Base::InstanceMethods)</a><br />
+ <a href="classes/ActsAsApi/Rendering.html#M000002">render_for_api (ActsAsApi::Rendering)</a><br />
+ </div>
+</div>
+</body>
+</html>
24 doc/index.html
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+
+<!--
+
+ acts_as_api-0.0.1 Documentation
+
+ -->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>acts_as_api-0.0.1 Documentation</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+</head>
+<frameset rows="20%, 80%">
+ <frameset cols="25%,35%,45%">
+ <frame src="fr_file_index.html" title="Files" name="Files" />
+ <frame src="fr_class_index.html" name="Classes" />
+ <frame src="fr_method_index.html" name="Methods" />
+ </frameset>
+ <frame src="files/lib/acts_as_api/array_rb.html" name="docwin" />
+</frameset>
+</html>
208 doc/rdoc-style.css
@@ -0,0 +1,208 @@
+
+body {
+ font-family: Verdana,Arial,Helvetica,sans-serif;
+ font-size: 90%;
+ margin: 0;
+ margin-left: 40px;
+ padding: 0;
+ background: white;
+}
+
+h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
+h1 { font-size: 150%; }
+h2,h3,h4 { margin-top: 1em; }
+
+a { background: #eef; color: #039; text-decoration: none; }
+a:hover { background: #039; color: #eef; }