simplesync 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +16 -0
 - data/README +40 -0
 - data/Rakefile +78 -0
 - data/doc/classes/Hash.html +153 -0
 - data/doc/classes/Hash.src/M000001.html +28 -0
 - data/doc/classes/SimpleSync.html +121 -0
 - data/doc/classes/SimpleSync/Mappings.html +169 -0
 - data/doc/classes/SimpleSync/Mappings.src/M000026.html +19 -0
 - data/doc/classes/SimpleSync/Mappings.src/M000027.html +20 -0
 - data/doc/classes/SimpleSync/Record.html +188 -0
 - data/doc/classes/SimpleSync/Record.src/M000002.html +22 -0
 - data/doc/classes/SimpleSync/Record.src/M000003.html +23 -0
 - data/doc/classes/SimpleSync/Record.src/M000004.html +25 -0
 - data/doc/classes/SimpleSync/RecordSet.html +235 -0
 - data/doc/classes/SimpleSync/RecordSet.src/M000028.html +23 -0
 - data/doc/classes/SimpleSync/RecordSet.src/M000029.html +18 -0
 - data/doc/classes/SimpleSync/RecordSet.src/M000030.html +19 -0
 - data/doc/classes/SimpleSync/RecordSet.src/M000031.html +20 -0
 - data/doc/classes/SimpleSync/RecordSet.src/M000032.html +18 -0
 - data/doc/classes/SimpleSync/Source.html +356 -0
 - data/doc/classes/SimpleSync/Source.src/M000005.html +19 -0
 - data/doc/classes/SimpleSync/Source.src/M000006.html +19 -0
 - data/doc/classes/SimpleSync/Source.src/M000007.html +19 -0
 - data/doc/classes/SimpleSync/Source.src/M000008.html +22 -0
 - data/doc/classes/SimpleSync/Source.src/M000009.html +18 -0
 - data/doc/classes/SimpleSync/Source.src/M000010.html +20 -0
 - data/doc/classes/SimpleSync/Source.src/M000011.html +22 -0
 - data/doc/classes/SimpleSync/Source.src/M000012.html +18 -0
 - data/doc/classes/SimpleSync/Source.src/M000013.html +18 -0
 - data/doc/classes/SimpleSync/Syncer.html +408 -0
 - data/doc/classes/SimpleSync/Syncer.src/M000014.html +18 -0
 - data/doc/classes/SimpleSync/Syncer.src/M000015.html +18 -0
 - data/doc/classes/SimpleSync/Syncer.src/M000016.html +18 -0
 - data/doc/classes/SimpleSync/Syncer.src/M000017.html +18 -0
 - data/doc/classes/SimpleSync/Syncer.src/M000018.html +18 -0
 - data/doc/classes/SimpleSync/Syncer.src/M000019.html +18 -0
 - data/doc/classes/SimpleSync/Syncer.src/M000020.html +18 -0
 - data/doc/classes/SimpleSync/Syncer.src/M000021.html +18 -0
 - data/doc/classes/SimpleSync/Syncer.src/M000022.html +35 -0
 - data/doc/classes/SimpleSync/Syncer.src/M000023.html +44 -0
 - data/doc/classes/SimpleSync/Syncer.src/M000024.html +41 -0
 - data/doc/classes/SimpleSync/Syncer.src/M000025.html +25 -0
 - data/doc/created.rid +1 -0
 - data/doc/files/LICENSE.html +129 -0
 - data/doc/files/README.html +155 -0
 - data/doc/files/lib/simple_sync_rb.html +107 -0
 - data/doc/fr_class_index.html +33 -0
 - data/doc/fr_file_index.html +29 -0
 - data/doc/fr_method_index.html +58 -0
 - data/doc/index.html +24 -0
 - data/doc/rdoc-style.css +208 -0
 - data/lib/simple_sync.rb +387 -0
 - metadata +115 -0
 
    
        data/LICENSE
    ADDED
    
    | 
         @@ -0,0 +1,16 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Copyright (c) 2008 BehindLogic
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
         
     | 
| 
      
 4 
     | 
    
         
            +
            and associated documentation files (the "Software"), to deal in the Software without restriction, 
         
     | 
| 
      
 5 
     | 
    
         
            +
            including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
         
     | 
| 
      
 6 
     | 
    
         
            +
            and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 
         
     | 
| 
      
 7 
     | 
    
         
            +
            subject to the following conditions:
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            The above copyright notice and this permission notice shall be included in all copies or substantial 
         
     | 
| 
      
 10 
     | 
    
         
            +
            portions of the Software.
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 
         
     | 
| 
      
 13 
     | 
    
         
            +
            LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 
         
     | 
| 
      
 14 
     | 
    
         
            +
            NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
         
     | 
| 
      
 15 
     | 
    
         
            +
            IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 
         
     | 
| 
      
 16 
     | 
    
         
            +
            OR OTHER DEALINGS IN THE SOFTWARE.
         
     | 
    
        data/README
    ADDED
    
    | 
         @@ -0,0 +1,40 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            == SimpleSync
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            The purpose of this gem is to provide a body that can perform the synchronization necessary when given the right inputs.
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            It is based on the idea that synchronization is a combination of: 1) data sources, 2) records, 3) attribute mappings, and 4) synchronization logic. This gem encapsulates all of these so that you don't have to worry about how they relate to each other -- only about defining what they are. You initialize your data sources, define how to find the relevant records, define how to map attributes between sources, and provide methods on your source that can be used to get and save records. See the example code:
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
              @sync = SimpleSync::Syncer.new(Time.now - 30*24*60*60)
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
              @local = @sync.add_source(Person, :local, :external_id) {@adapter = :local}.extended(@sync) do |s|
         
     | 
| 
      
 10 
     | 
    
         
            +
                new_records {Person.get(:adapter => :local, :created_after => s.last_sync)}
         
     | 
| 
      
 11 
     | 
    
         
            +
                changed_records {Person.get(:adapter => :local, :updated_after => s.last_sync)}
         
     | 
| 
      
 12 
     | 
    
         
            +
                deleted_records {DeletedRecord.get(:adapter => :local, :object_type => 'Person', :deleted_after => s.last_sync)}
         
     | 
| 
      
 13 
     | 
    
         
            +
              end
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
              @remote = @sync.add_source(Person, :remote, :self) {@adapter = :opcon_local}.extended(@sync) do |s|
         
     | 
| 
      
 16 
     | 
    
         
            +
                new_records {Person.get(:adapter => :remote, :created_after => s.last_sync)}
         
     | 
| 
      
 17 
     | 
    
         
            +
                changed_records {Person.get(:adapter => :remote, :updated_after => s.last_sync)}
         
     | 
| 
      
 18 
     | 
    
         
            +
                deleted_records {DeletedRecord.get(:adapter => :remote, :object_type => 'Person', :deleted_after => s.last_sync)}
         
     | 
| 
      
 19 
     | 
    
         
            +
              end
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
              # Mapping the attributes from one to the other.
         
     | 
| 
      
 22 
     | 
    
         
            +
              @sync.mappings[@local => @remote] = {
         
     | 
| 
      
 23 
     | 
    
         
            +
                'first_name' => 'first_name',
         
     | 
| 
      
 24 
     | 
    
         
            +
                'last_name' => 'last_name',
         
     | 
| 
      
 25 
     | 
    
         
            +
                'company_name' => 'company_name',
         
     | 
| 
      
 26 
     | 
    
         
            +
                'birthdate' => 'birthdate',
         
     | 
| 
      
 27 
     | 
    
         
            +
              }
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
              # And the other direction -- usually just in invert.
         
     | 
| 
      
 30 
     | 
    
         
            +
              @sync.mappings[@remote => @local] = @sync.mappings[@local => @remote].invert
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
              # Now all we need to do is a simple loop where we sync and wait.
         
     | 
| 
      
 33 
     | 
    
         
            +
              while(1)
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                puts "[#{Time.now}] Beginning Sync"
         
     | 
| 
      
 36 
     | 
    
         
            +
                @sync.sync!
         
     | 
| 
      
 37 
     | 
    
         
            +
                puts "[#{Time.now}] Finished Syncing"
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
                sleep(30)
         
     | 
| 
      
 40 
     | 
    
         
            +
              end
         
     | 
    
        data/Rakefile
    ADDED
    
    | 
         @@ -0,0 +1,78 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'rubygems'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'rake'
         
     | 
| 
      
 3 
     | 
    
         
            +
            require 'rake/testtask'
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'rake/rdoctask'
         
     | 
| 
      
 5 
     | 
    
         
            +
            require 'rake/gempackagetask'
         
     | 
| 
      
 6 
     | 
    
         
            +
            require 'rake/contrib/rubyforgepublisher'
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            PKG_NAME = 'simplesync'
         
     | 
| 
      
 9 
     | 
    
         
            +
            PKG_VERSION = "0.0.2"
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            PKG_FILES = FileList[
         
     | 
| 
      
 12 
     | 
    
         
            +
                "lib/**/*", "rspec/**/*", "[A-Z]*", "Rakefile", "doc/**/*"
         
     | 
| 
      
 13 
     | 
    
         
            +
            ]
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            desc "Default Task"
         
     | 
| 
      
 16 
     | 
    
         
            +
            task :default => [ :test ] do
         
     | 
| 
      
 17 
     | 
    
         
            +
              # Run the unit tests
         
     | 
| 
      
 18 
     | 
    
         
            +
              desc "Run all rspec tests (rake task not yet implemented!)"
         
     | 
| 
      
 19 
     | 
    
         
            +
            end
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            # Make a console, useful when working on tests
         
     | 
| 
      
 22 
     | 
    
         
            +
            desc "Generate a test console"
         
     | 
| 
      
 23 
     | 
    
         
            +
            task :console do
         
     | 
| 
      
 24 
     | 
    
         
            +
               verbose( false ) { sh "irb -I lib/ -r '#{PKG_NAME}'" }
         
     | 
| 
      
 25 
     | 
    
         
            +
            end
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            # Genereate the RDoc documentation
         
     | 
| 
      
 28 
     | 
    
         
            +
            desc "Create documentation"
         
     | 
| 
      
 29 
     | 
    
         
            +
            Rake::RDocTask.new("doc") { |rdoc|
         
     | 
| 
      
 30 
     | 
    
         
            +
              rdoc.title = "SimpleSync"
         
     | 
| 
      
 31 
     | 
    
         
            +
              rdoc.rdoc_dir = 'doc'
         
     | 
| 
      
 32 
     | 
    
         
            +
              rdoc.rdoc_files.include('README')
         
     | 
| 
      
 33 
     | 
    
         
            +
              rdoc.rdoc_files.include('LICENSE')
         
     | 
| 
      
 34 
     | 
    
         
            +
              rdoc.rdoc_files.include('lib/**/*.rb')
         
     | 
| 
      
 35 
     | 
    
         
            +
            }
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
            # Generate the package
         
     | 
| 
      
 38 
     | 
    
         
            +
            spec = Gem::Specification.new do |s|
         
     | 
| 
      
 39 
     | 
    
         
            +
              #### Basic information.
         
     | 
| 
      
 40 
     | 
    
         
            +
              s.name = PKG_NAME
         
     | 
| 
      
 41 
     | 
    
         
            +
              s.version = PKG_VERSION
         
     | 
| 
      
 42 
     | 
    
         
            +
              s.platform = Gem::Platform::RUBY
         
     | 
| 
      
 43 
     | 
    
         
            +
              s.description = s.summary = "QuickSync: an interface to synchronization logic."
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
              #### Which files are to be included in this gem?  Everything!  (Except CVS directories.)
         
     | 
| 
      
 46 
     | 
    
         
            +
              s.files = PKG_FILES
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
              #### Load-time details: library and application (you will need one or both).
         
     | 
| 
      
 49 
     | 
    
         
            +
              s.require_path = 'lib'
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
              #### Documentation and testing.
         
     | 
| 
      
 52 
     | 
    
         
            +
              s.has_rdoc = true
         
     | 
| 
      
 53 
     | 
    
         
            +
              s.extra_rdoc_files = ["README", "LICENSE"]
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
              #### Author and project details.
         
     | 
| 
      
 56 
     | 
    
         
            +
              s.author = "Daniel Parker"
         
     | 
| 
      
 57 
     | 
    
         
            +
              s.email = "gems@behindlogic.com"
         
     | 
| 
      
 58 
     | 
    
         
            +
              s.homepage = "http://simplesync.rubyforge.org"
         
     | 
| 
      
 59 
     | 
    
         
            +
              s.rubyforge_project = 'simplesync'
         
     | 
| 
      
 60 
     | 
    
         
            +
            end
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
            Rake::GemPackageTask.new(spec) do |pkg|
         
     | 
| 
      
 63 
     | 
    
         
            +
              pkg.need_zip = false
         
     | 
| 
      
 64 
     | 
    
         
            +
              pkg.need_tar = false
         
     | 
| 
      
 65 
     | 
    
         
            +
            end
         
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
      
 67 
     | 
    
         
            +
            desc "Report code statistics (KLOCs, etc) from the application"
         
     | 
| 
      
 68 
     | 
    
         
            +
            task :stats do
         
     | 
| 
      
 69 
     | 
    
         
            +
              require 'code_statistics'
         
     | 
| 
      
 70 
     | 
    
         
            +
              CodeStatistics.new(
         
     | 
| 
      
 71 
     | 
    
         
            +
                ["Library", "lib"]
         
     | 
| 
      
 72 
     | 
    
         
            +
              ).to_s
         
     | 
| 
      
 73 
     | 
    
         
            +
            end
         
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
      
 75 
     | 
    
         
            +
            desc "Publish new documentation"
         
     | 
| 
      
 76 
     | 
    
         
            +
            task :publish => [:doc] do
         
     | 
| 
      
 77 
     | 
    
         
            +
              `scp -r doc/* dcparker@rubyforge.org:/var/www/gforge-projects/simplesync`
         
     | 
| 
      
 78 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,153 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <?xml version="1.0" encoding="iso-8859-1"?>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <!DOCTYPE html 
         
     | 
| 
      
 3 
     | 
    
         
            +
                 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         
     | 
| 
      
 4 
     | 
    
         
            +
                 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
         
     | 
| 
      
 7 
     | 
    
         
            +
            <head>
         
     | 
| 
      
 8 
     | 
    
         
            +
              <title>Class: Hash</title>
         
     | 
| 
      
 9 
     | 
    
         
            +
              <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
         
     | 
| 
      
 10 
     | 
    
         
            +
              <meta http-equiv="Content-Script-Type" content="text/javascript" />
         
     | 
| 
      
 11 
     | 
    
         
            +
              <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
         
     | 
| 
      
 12 
     | 
    
         
            +
              <script type="text/javascript">
         
     | 
| 
      
 13 
     | 
    
         
            +
              // <![CDATA[
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
              function popupCode( url ) {
         
     | 
| 
      
 16 
     | 
    
         
            +
                window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
         
     | 
| 
      
 17 
     | 
    
         
            +
              }
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
              function toggleCode( id ) {
         
     | 
| 
      
 20 
     | 
    
         
            +
                if ( document.getElementById )
         
     | 
| 
      
 21 
     | 
    
         
            +
                  elem = document.getElementById( id );
         
     | 
| 
      
 22 
     | 
    
         
            +
                else if ( document.all )
         
     | 
| 
      
 23 
     | 
    
         
            +
                  elem = eval( "document.all." + id );
         
     | 
| 
      
 24 
     | 
    
         
            +
                else
         
     | 
| 
      
 25 
     | 
    
         
            +
                  return false;
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                elemStyle = elem.style;
         
     | 
| 
      
 28 
     | 
    
         
            +
                
         
     | 
| 
      
 29 
     | 
    
         
            +
                if ( elemStyle.display != "block" ) {
         
     | 
| 
      
 30 
     | 
    
         
            +
                  elemStyle.display = "block"
         
     | 
| 
      
 31 
     | 
    
         
            +
                } else {
         
     | 
| 
      
 32 
     | 
    
         
            +
                  elemStyle.display = "none"
         
     | 
| 
      
 33 
     | 
    
         
            +
                }
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                return true;
         
     | 
| 
      
 36 
     | 
    
         
            +
              }
         
     | 
| 
      
 37 
     | 
    
         
            +
              
         
     | 
| 
      
 38 
     | 
    
         
            +
              // Make codeblocks hidden by default
         
     | 
| 
      
 39 
     | 
    
         
            +
              document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
         
     | 
| 
      
 40 
     | 
    
         
            +
              
         
     | 
| 
      
 41 
     | 
    
         
            +
              // ]]>
         
     | 
| 
      
 42 
     | 
    
         
            +
              </script>
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
            </head>
         
     | 
| 
      
 45 
     | 
    
         
            +
            <body>
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 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">Hash</td>
         
     | 
| 
      
 54 
     | 
    
         
            +
                    </tr>
         
     | 
| 
      
 55 
     | 
    
         
            +
                    <tr class="top-aligned-row">
         
     | 
| 
      
 56 
     | 
    
         
            +
                        <td><strong>In:</strong></td>
         
     | 
| 
      
 57 
     | 
    
         
            +
                        <td>
         
     | 
| 
      
 58 
     | 
    
         
            +
                            <a href="../files/lib/simple_sync_rb.html">
         
     | 
| 
      
 59 
     | 
    
         
            +
                            lib/simple_sync.rb
         
     | 
| 
      
 60 
     | 
    
         
            +
                            </a>
         
     | 
| 
      
 61 
     | 
    
         
            +
                    <br />
         
     | 
| 
      
 62 
     | 
    
         
            +
                        </td>
         
     | 
| 
      
 63 
     | 
    
         
            +
                    </tr>
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
                    <tr class="top-aligned-row">
         
     | 
| 
      
 66 
     | 
    
         
            +
                        <td><strong>Parent:</strong></td>
         
     | 
| 
      
 67 
     | 
    
         
            +
                        <td>
         
     | 
| 
      
 68 
     | 
    
         
            +
                            Object
         
     | 
| 
      
 69 
     | 
    
         
            +
                        </td>
         
     | 
| 
      
 70 
     | 
    
         
            +
                    </tr>
         
     | 
| 
      
 71 
     | 
    
         
            +
                    </table>
         
     | 
| 
      
 72 
     | 
    
         
            +
                </div>
         
     | 
| 
      
 73 
     | 
    
         
            +
              <!-- banner header -->
         
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
      
 75 
     | 
    
         
            +
              <div id="bodyContent">
         
     | 
| 
      
 76 
     | 
    
         
            +
             
     | 
| 
      
 77 
     | 
    
         
            +
             
     | 
| 
      
 78 
     | 
    
         
            +
             
     | 
| 
      
 79 
     | 
    
         
            +
              <div id="contextContent">
         
     | 
| 
      
 80 
     | 
    
         
            +
             
     | 
| 
      
 81 
     | 
    
         
            +
                <div id="description">
         
     | 
| 
      
 82 
     | 
    
         
            +
                  <p>
         
     | 
| 
      
 83 
     | 
    
         
            +
            A little enhancement that we need…
         
     | 
| 
      
 84 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 85 
     | 
    
         
            +
             
     | 
| 
      
 86 
     | 
    
         
            +
                </div>
         
     | 
| 
      
 87 
     | 
    
         
            +
             
     | 
| 
      
 88 
     | 
    
         
            +
             
     | 
| 
      
 89 
     | 
    
         
            +
               </div>
         
     | 
| 
      
 90 
     | 
    
         
            +
             
     | 
| 
      
 91 
     | 
    
         
            +
                <div id="method-list">
         
     | 
| 
      
 92 
     | 
    
         
            +
                  <h3 class="section-bar">Methods</h3>
         
     | 
| 
      
 93 
     | 
    
         
            +
             
     | 
| 
      
 94 
     | 
    
         
            +
                  <div class="name-list">
         
     | 
| 
      
 95 
     | 
    
         
            +
                  <a href="#M000001">transform_keys_by_mapping</a>  
         
     | 
| 
      
 96 
     | 
    
         
            +
                  </div>
         
     | 
| 
      
 97 
     | 
    
         
            +
                </div>
         
     | 
| 
      
 98 
     | 
    
         
            +
             
     | 
| 
      
 99 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 100 
     | 
    
         
            +
             
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
      
 102 
     | 
    
         
            +
                <!-- if includes -->
         
     | 
| 
      
 103 
     | 
    
         
            +
             
     | 
| 
      
 104 
     | 
    
         
            +
                <div id="section">
         
     | 
| 
      
 105 
     | 
    
         
            +
             
     | 
| 
      
 106 
     | 
    
         
            +
             
     | 
| 
      
 107 
     | 
    
         
            +
             
     | 
| 
      
 108 
     | 
    
         
            +
             
     | 
| 
      
 109 
     | 
    
         
            +
             
     | 
| 
      
 110 
     | 
    
         
            +
                  
         
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
      
 112 
     | 
    
         
            +
             
     | 
| 
      
 113 
     | 
    
         
            +
                <!-- if method_list -->
         
     | 
| 
      
 114 
     | 
    
         
            +
                <div id="methods">
         
     | 
| 
      
 115 
     | 
    
         
            +
                  <h3 class="section-bar">Public Instance methods</h3>
         
     | 
| 
      
 116 
     | 
    
         
            +
             
     | 
| 
      
 117 
     | 
    
         
            +
                  <div id="method-M000001" class="method-detail">
         
     | 
| 
      
 118 
     | 
    
         
            +
                    <a name="M000001"></a>
         
     | 
| 
      
 119 
     | 
    
         
            +
             
     | 
| 
      
 120 
     | 
    
         
            +
                    <div class="method-heading">
         
     | 
| 
      
 121 
     | 
    
         
            +
                      <a href="Hash.src/M000001.html" target="Code" class="method-signature"
         
     | 
| 
      
 122 
     | 
    
         
            +
                        onclick="popupCode('Hash.src/M000001.html');return false;">
         
     | 
| 
      
 123 
     | 
    
         
            +
                      <span class="method-name">transform_keys_by_mapping</span><span class="method-args">(mapping)</span>
         
     | 
| 
      
 124 
     | 
    
         
            +
                      </a>
         
     | 
| 
      
 125 
     | 
    
         
            +
                    </div>
         
     | 
| 
      
 126 
     | 
    
         
            +
                  
         
     | 
| 
      
 127 
     | 
    
         
            +
                    <div class="method-description">
         
     | 
| 
      
 128 
     | 
    
         
            +
                      <p>
         
     | 
| 
      
 129 
     | 
    
         
            +
            Given a mapping (hash), this will transform the keys from the keys to the
         
     | 
| 
      
 130 
     | 
    
         
            +
            values in the mapping. For example:
         
     | 
| 
      
 131 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 132 
     | 
    
         
            +
            <pre>
         
     | 
| 
      
 133 
     | 
    
         
            +
              mapping = {:cat => :Cat, :dog => :Canine}
         
     | 
| 
      
 134 
     | 
    
         
            +
              hash = {:cat => 'Felix', :dog => 'Toby'}
         
     | 
| 
      
 135 
     | 
    
         
            +
              hash.transform_keys_by_mapping(mapping)
         
     | 
| 
      
 136 
     | 
    
         
            +
              => {:Cat => 'Felix', :Canine => 'Toby'}
         
     | 
| 
      
 137 
     | 
    
         
            +
            </pre>
         
     | 
| 
      
 138 
     | 
    
         
            +
                    </div>
         
     | 
| 
      
 139 
     | 
    
         
            +
                  </div>
         
     | 
| 
      
 140 
     | 
    
         
            +
             
     | 
| 
      
 141 
     | 
    
         
            +
             
     | 
| 
      
 142 
     | 
    
         
            +
                </div>
         
     | 
| 
      
 143 
     | 
    
         
            +
             
     | 
| 
      
 144 
     | 
    
         
            +
             
     | 
| 
      
 145 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 146 
     | 
    
         
            +
             
     | 
| 
      
 147 
     | 
    
         
            +
             
     | 
| 
      
 148 
     | 
    
         
            +
            <div id="validator-badges">
         
     | 
| 
      
 149 
     | 
    
         
            +
              <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
         
     | 
| 
      
 150 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 151 
     | 
    
         
            +
             
     | 
| 
      
 152 
     | 
    
         
            +
            </body>
         
     | 
| 
      
 153 
     | 
    
         
            +
            </html>
         
     | 
| 
         @@ -0,0 +1,28 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <?xml version="1.0" encoding="iso-8859-1"?>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <!DOCTYPE html 
         
     | 
| 
      
 3 
     | 
    
         
            +
                 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         
     | 
| 
      
 4 
     | 
    
         
            +
                 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            <html>
         
     | 
| 
      
 7 
     | 
    
         
            +
            <head>
         
     | 
| 
      
 8 
     | 
    
         
            +
              <title>transform_keys_by_mapping (Hash)</title>
         
     | 
| 
      
 9 
     | 
    
         
            +
              <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
         
     | 
| 
      
 10 
     | 
    
         
            +
              <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
         
     | 
| 
      
 11 
     | 
    
         
            +
            </head>
         
     | 
| 
      
 12 
     | 
    
         
            +
            <body class="standalone-code">
         
     | 
| 
      
 13 
     | 
    
         
            +
              <pre><span class="ruby-comment cmt"># File lib/simple_sync.rb, line 374</span>
         
     | 
| 
      
 14 
     | 
    
         
            +
              <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">transform_keys_by_mapping</span>(<span class="ruby-identifier">mapping</span>)
         
     | 
| 
      
 15 
     | 
    
         
            +
                <span class="ruby-identifier">ddup</span> = {}
         
     | 
| 
      
 16 
     | 
    
         
            +
                <span class="ruby-keyword kw">self</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>
         
     | 
| 
      
 17 
     | 
    
         
            +
                  <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mapping</span>[<span class="ruby-identifier">k</span>]
         
     | 
| 
      
 18 
     | 
    
         
            +
                    <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">mapping</span>[<span class="ruby-identifier">k</span>].<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Proc</span>)
         
     | 
| 
      
 19 
     | 
    
         
            +
                      <span class="ruby-identifier">ddup</span> = <span class="ruby-identifier">mapping</span>[<span class="ruby-identifier">k</span>].<span class="ruby-identifier">call</span>(<span class="ruby-identifier">ddup</span>,<span class="ruby-identifier">v</span>)
         
     | 
| 
      
 20 
     | 
    
         
            +
                    <span class="ruby-keyword kw">else</span>
         
     | 
| 
      
 21 
     | 
    
         
            +
                      <span class="ruby-identifier">ddup</span>[<span class="ruby-identifier">mapping</span>[<span class="ruby-identifier">k</span>]] = <span class="ruby-identifier">v</span>
         
     | 
| 
      
 22 
     | 
    
         
            +
                    <span class="ruby-keyword kw">end</span>
         
     | 
| 
      
 23 
     | 
    
         
            +
                  <span class="ruby-keyword kw">end</span>
         
     | 
| 
      
 24 
     | 
    
         
            +
                <span class="ruby-keyword kw">end</span>
         
     | 
| 
      
 25 
     | 
    
         
            +
                <span class="ruby-identifier">ddup</span>
         
     | 
| 
      
 26 
     | 
    
         
            +
              <span class="ruby-keyword kw">end</span></pre>
         
     | 
| 
      
 27 
     | 
    
         
            +
            </body>
         
     | 
| 
      
 28 
     | 
    
         
            +
            </html>
         
     | 
| 
         @@ -0,0 +1,121 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <?xml version="1.0" encoding="iso-8859-1"?>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <!DOCTYPE html 
         
     | 
| 
      
 3 
     | 
    
         
            +
                 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         
     | 
| 
      
 4 
     | 
    
         
            +
                 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
         
     | 
| 
      
 7 
     | 
    
         
            +
            <head>
         
     | 
| 
      
 8 
     | 
    
         
            +
              <title>Module: SimpleSync</title>
         
     | 
| 
      
 9 
     | 
    
         
            +
              <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
         
     | 
| 
      
 10 
     | 
    
         
            +
              <meta http-equiv="Content-Script-Type" content="text/javascript" />
         
     | 
| 
      
 11 
     | 
    
         
            +
              <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
         
     | 
| 
      
 12 
     | 
    
         
            +
              <script type="text/javascript">
         
     | 
| 
      
 13 
     | 
    
         
            +
              // <![CDATA[
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
              function popupCode( url ) {
         
     | 
| 
      
 16 
     | 
    
         
            +
                window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
         
     | 
| 
      
 17 
     | 
    
         
            +
              }
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
              function toggleCode( id ) {
         
     | 
| 
      
 20 
     | 
    
         
            +
                if ( document.getElementById )
         
     | 
| 
      
 21 
     | 
    
         
            +
                  elem = document.getElementById( id );
         
     | 
| 
      
 22 
     | 
    
         
            +
                else if ( document.all )
         
     | 
| 
      
 23 
     | 
    
         
            +
                  elem = eval( "document.all." + id );
         
     | 
| 
      
 24 
     | 
    
         
            +
                else
         
     | 
| 
      
 25 
     | 
    
         
            +
                  return false;
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                elemStyle = elem.style;
         
     | 
| 
      
 28 
     | 
    
         
            +
                
         
     | 
| 
      
 29 
     | 
    
         
            +
                if ( elemStyle.display != "block" ) {
         
     | 
| 
      
 30 
     | 
    
         
            +
                  elemStyle.display = "block"
         
     | 
| 
      
 31 
     | 
    
         
            +
                } else {
         
     | 
| 
      
 32 
     | 
    
         
            +
                  elemStyle.display = "none"
         
     | 
| 
      
 33 
     | 
    
         
            +
                }
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                return true;
         
     | 
| 
      
 36 
     | 
    
         
            +
              }
         
     | 
| 
      
 37 
     | 
    
         
            +
              
         
     | 
| 
      
 38 
     | 
    
         
            +
              // Make codeblocks hidden by default
         
     | 
| 
      
 39 
     | 
    
         
            +
              document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
         
     | 
| 
      
 40 
     | 
    
         
            +
              
         
     | 
| 
      
 41 
     | 
    
         
            +
              // ]]>
         
     | 
| 
      
 42 
     | 
    
         
            +
              </script>
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
            </head>
         
     | 
| 
      
 45 
     | 
    
         
            +
            <body>
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
                <div id="classHeader">
         
     | 
| 
      
 50 
     | 
    
         
            +
                    <table class="header-table">
         
     | 
| 
      
 51 
     | 
    
         
            +
                    <tr class="top-aligned-row">
         
     | 
| 
      
 52 
     | 
    
         
            +
                      <td><strong>Module</strong></td>
         
     | 
| 
      
 53 
     | 
    
         
            +
                      <td class="class-name-in-header">SimpleSync</td>
         
     | 
| 
      
 54 
     | 
    
         
            +
                    </tr>
         
     | 
| 
      
 55 
     | 
    
         
            +
                    <tr class="top-aligned-row">
         
     | 
| 
      
 56 
     | 
    
         
            +
                        <td><strong>In:</strong></td>
         
     | 
| 
      
 57 
     | 
    
         
            +
                        <td>
         
     | 
| 
      
 58 
     | 
    
         
            +
                            <a href="../files/lib/simple_sync_rb.html">
         
     | 
| 
      
 59 
     | 
    
         
            +
                            lib/simple_sync.rb
         
     | 
| 
      
 60 
     | 
    
         
            +
                            </a>
         
     | 
| 
      
 61 
     | 
    
         
            +
                    <br />
         
     | 
| 
      
 62 
     | 
    
         
            +
                        </td>
         
     | 
| 
      
 63 
     | 
    
         
            +
                    </tr>
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
                    </table>
         
     | 
| 
      
 66 
     | 
    
         
            +
                </div>
         
     | 
| 
      
 67 
     | 
    
         
            +
              <!-- banner header -->
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
              <div id="bodyContent">
         
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
      
 71 
     | 
    
         
            +
             
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
      
 73 
     | 
    
         
            +
              <div id="contextContent">
         
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
      
 75 
     | 
    
         
            +
                <div id="description">
         
     | 
| 
      
 76 
     | 
    
         
            +
                  <p>
         
     | 
| 
      
 77 
     | 
    
         
            +
            See README for usage.
         
     | 
| 
      
 78 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 79 
     | 
    
         
            +
             
     | 
| 
      
 80 
     | 
    
         
            +
                </div>
         
     | 
| 
      
 81 
     | 
    
         
            +
             
     | 
| 
      
 82 
     | 
    
         
            +
             
     | 
| 
      
 83 
     | 
    
         
            +
               </div>
         
     | 
| 
      
 84 
     | 
    
         
            +
             
     | 
| 
      
 85 
     | 
    
         
            +
             
     | 
| 
      
 86 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 87 
     | 
    
         
            +
             
     | 
| 
      
 88 
     | 
    
         
            +
             
     | 
| 
      
 89 
     | 
    
         
            +
                <!-- if includes -->
         
     | 
| 
      
 90 
     | 
    
         
            +
             
     | 
| 
      
 91 
     | 
    
         
            +
                <div id="section">
         
     | 
| 
      
 92 
     | 
    
         
            +
             
     | 
| 
      
 93 
     | 
    
         
            +
                <div id="class-list">
         
     | 
| 
      
 94 
     | 
    
         
            +
                  <h3 class="section-bar">Classes and Modules</h3>
         
     | 
| 
      
 95 
     | 
    
         
            +
             
     | 
| 
      
 96 
     | 
    
         
            +
                  Module <a href="SimpleSync/Record.html" class="link">SimpleSync::Record</a><br />
         
     | 
| 
      
 97 
     | 
    
         
            +
            Class <a href="SimpleSync/Mappings.html" class="link">SimpleSync::Mappings</a><br />
         
     | 
| 
      
 98 
     | 
    
         
            +
            Class <a href="SimpleSync/RecordSet.html" class="link">SimpleSync::RecordSet</a><br />
         
     | 
| 
      
 99 
     | 
    
         
            +
            Class <a href="SimpleSync/Source.html" class="link">SimpleSync::Source</a><br />
         
     | 
| 
      
 100 
     | 
    
         
            +
            Class <a href="SimpleSync/Syncer.html" class="link">SimpleSync::Syncer</a><br />
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
      
 102 
     | 
    
         
            +
                </div>
         
     | 
| 
      
 103 
     | 
    
         
            +
             
     | 
| 
      
 104 
     | 
    
         
            +
             
     | 
| 
      
 105 
     | 
    
         
            +
             
     | 
| 
      
 106 
     | 
    
         
            +
             
     | 
| 
      
 107 
     | 
    
         
            +
                  
         
     | 
| 
      
 108 
     | 
    
         
            +
             
     | 
| 
      
 109 
     | 
    
         
            +
             
     | 
| 
      
 110 
     | 
    
         
            +
                <!-- if method_list -->
         
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
      
 112 
     | 
    
         
            +
             
     | 
| 
      
 113 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 114 
     | 
    
         
            +
             
     | 
| 
      
 115 
     | 
    
         
            +
             
     | 
| 
      
 116 
     | 
    
         
            +
            <div id="validator-badges">
         
     | 
| 
      
 117 
     | 
    
         
            +
              <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
         
     | 
| 
      
 118 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 119 
     | 
    
         
            +
             
     | 
| 
      
 120 
     | 
    
         
            +
            </body>
         
     | 
| 
      
 121 
     | 
    
         
            +
            </html>
         
     | 
| 
         @@ -0,0 +1,169 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <?xml version="1.0" encoding="iso-8859-1"?>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <!DOCTYPE html 
         
     | 
| 
      
 3 
     | 
    
         
            +
                 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         
     | 
| 
      
 4 
     | 
    
         
            +
                 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
         
     | 
| 
      
 7 
     | 
    
         
            +
            <head>
         
     | 
| 
      
 8 
     | 
    
         
            +
              <title>Class: SimpleSync::Mappings</title>
         
     | 
| 
      
 9 
     | 
    
         
            +
              <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
         
     | 
| 
      
 10 
     | 
    
         
            +
              <meta http-equiv="Content-Script-Type" content="text/javascript" />
         
     | 
| 
      
 11 
     | 
    
         
            +
              <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
         
     | 
| 
      
 12 
     | 
    
         
            +
              <script type="text/javascript">
         
     | 
| 
      
 13 
     | 
    
         
            +
              // <![CDATA[
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
              function popupCode( url ) {
         
     | 
| 
      
 16 
     | 
    
         
            +
                window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
         
     | 
| 
      
 17 
     | 
    
         
            +
              }
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
              function toggleCode( id ) {
         
     | 
| 
      
 20 
     | 
    
         
            +
                if ( document.getElementById )
         
     | 
| 
      
 21 
     | 
    
         
            +
                  elem = document.getElementById( id );
         
     | 
| 
      
 22 
     | 
    
         
            +
                else if ( document.all )
         
     | 
| 
      
 23 
     | 
    
         
            +
                  elem = eval( "document.all." + id );
         
     | 
| 
      
 24 
     | 
    
         
            +
                else
         
     | 
| 
      
 25 
     | 
    
         
            +
                  return false;
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                elemStyle = elem.style;
         
     | 
| 
      
 28 
     | 
    
         
            +
                
         
     | 
| 
      
 29 
     | 
    
         
            +
                if ( elemStyle.display != "block" ) {
         
     | 
| 
      
 30 
     | 
    
         
            +
                  elemStyle.display = "block"
         
     | 
| 
      
 31 
     | 
    
         
            +
                } else {
         
     | 
| 
      
 32 
     | 
    
         
            +
                  elemStyle.display = "none"
         
     | 
| 
      
 33 
     | 
    
         
            +
                }
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                return true;
         
     | 
| 
      
 36 
     | 
    
         
            +
              }
         
     | 
| 
      
 37 
     | 
    
         
            +
              
         
     | 
| 
      
 38 
     | 
    
         
            +
              // Make codeblocks hidden by default
         
     | 
| 
      
 39 
     | 
    
         
            +
              document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
         
     | 
| 
      
 40 
     | 
    
         
            +
              
         
     | 
| 
      
 41 
     | 
    
         
            +
              // ]]>
         
     | 
| 
      
 42 
     | 
    
         
            +
              </script>
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
            </head>
         
     | 
| 
      
 45 
     | 
    
         
            +
            <body>
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 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">SimpleSync::Mappings</td>
         
     | 
| 
      
 54 
     | 
    
         
            +
                    </tr>
         
     | 
| 
      
 55 
     | 
    
         
            +
                    <tr class="top-aligned-row">
         
     | 
| 
      
 56 
     | 
    
         
            +
                        <td><strong>In:</strong></td>
         
     | 
| 
      
 57 
     | 
    
         
            +
                        <td>
         
     | 
| 
      
 58 
     | 
    
         
            +
                            <a href="../../files/lib/simple_sync_rb.html">
         
     | 
| 
      
 59 
     | 
    
         
            +
                            lib/simple_sync.rb
         
     | 
| 
      
 60 
     | 
    
         
            +
                            </a>
         
     | 
| 
      
 61 
     | 
    
         
            +
                    <br />
         
     | 
| 
      
 62 
     | 
    
         
            +
                        </td>
         
     | 
| 
      
 63 
     | 
    
         
            +
                    </tr>
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
                    <tr class="top-aligned-row">
         
     | 
| 
      
 66 
     | 
    
         
            +
                        <td><strong>Parent:</strong></td>
         
     | 
| 
      
 67 
     | 
    
         
            +
                        <td>
         
     | 
| 
      
 68 
     | 
    
         
            +
                            Object
         
     | 
| 
      
 69 
     | 
    
         
            +
                        </td>
         
     | 
| 
      
 70 
     | 
    
         
            +
                    </tr>
         
     | 
| 
      
 71 
     | 
    
         
            +
                    </table>
         
     | 
| 
      
 72 
     | 
    
         
            +
                </div>
         
     | 
| 
      
 73 
     | 
    
         
            +
              <!-- banner header -->
         
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
      
 75 
     | 
    
         
            +
              <div id="bodyContent">
         
     | 
| 
      
 76 
     | 
    
         
            +
             
     | 
| 
      
 77 
     | 
    
         
            +
             
     | 
| 
      
 78 
     | 
    
         
            +
             
     | 
| 
      
 79 
     | 
    
         
            +
              <div id="contextContent">
         
     | 
| 
      
 80 
     | 
    
         
            +
             
     | 
| 
      
 81 
     | 
    
         
            +
                <div id="description">
         
     | 
| 
      
 82 
     | 
    
         
            +
                  <p>
         
     | 
| 
      
 83 
     | 
    
         
            +
            <a href="Mappings.html">Mappings</a> represents and encapsulates the
         
     | 
| 
      
 84 
     | 
    
         
            +
            mappings for a group of sync sources.
         
     | 
| 
      
 85 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 86 
     | 
    
         
            +
             
     | 
| 
      
 87 
     | 
    
         
            +
                </div>
         
     | 
| 
      
 88 
     | 
    
         
            +
             
     | 
| 
      
 89 
     | 
    
         
            +
             
     | 
| 
      
 90 
     | 
    
         
            +
               </div>
         
     | 
| 
      
 91 
     | 
    
         
            +
             
     | 
| 
      
 92 
     | 
    
         
            +
                <div id="method-list">
         
     | 
| 
      
 93 
     | 
    
         
            +
                  <h3 class="section-bar">Methods</h3>
         
     | 
| 
      
 94 
     | 
    
         
            +
             
     | 
| 
      
 95 
     | 
    
         
            +
                  <div class="name-list">
         
     | 
| 
      
 96 
     | 
    
         
            +
                  <a href="#M000026">[]</a>  
         
     | 
| 
      
 97 
     | 
    
         
            +
                  <a href="#M000027">[]=</a>  
         
     | 
| 
      
 98 
     | 
    
         
            +
                  </div>
         
     | 
| 
      
 99 
     | 
    
         
            +
                </div>
         
     | 
| 
      
 100 
     | 
    
         
            +
             
     | 
| 
      
 101 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 102 
     | 
    
         
            +
             
     | 
| 
      
 103 
     | 
    
         
            +
             
     | 
| 
      
 104 
     | 
    
         
            +
                <!-- if includes -->
         
     | 
| 
      
 105 
     | 
    
         
            +
             
     | 
| 
      
 106 
     | 
    
         
            +
                <div id="section">
         
     | 
| 
      
 107 
     | 
    
         
            +
             
     | 
| 
      
 108 
     | 
    
         
            +
             
     | 
| 
      
 109 
     | 
    
         
            +
             
     | 
| 
      
 110 
     | 
    
         
            +
             
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
      
 112 
     | 
    
         
            +
                  
         
     | 
| 
      
 113 
     | 
    
         
            +
             
     | 
| 
      
 114 
     | 
    
         
            +
             
     | 
| 
      
 115 
     | 
    
         
            +
                <!-- if method_list -->
         
     | 
| 
      
 116 
     | 
    
         
            +
                <div id="methods">
         
     | 
| 
      
 117 
     | 
    
         
            +
                  <h3 class="section-bar">Public Instance methods</h3>
         
     | 
| 
      
 118 
     | 
    
         
            +
             
     | 
| 
      
 119 
     | 
    
         
            +
                  <div id="method-M000026" class="method-detail">
         
     | 
| 
      
 120 
     | 
    
         
            +
                    <a name="M000026"></a>
         
     | 
| 
      
 121 
     | 
    
         
            +
             
     | 
| 
      
 122 
     | 
    
         
            +
                    <div class="method-heading">
         
     | 
| 
      
 123 
     | 
    
         
            +
                      <a href="Mappings.src/M000026.html" target="Code" class="method-signature"
         
     | 
| 
      
 124 
     | 
    
         
            +
                        onclick="popupCode('Mappings.src/M000026.html');return false;">
         
     | 
| 
      
 125 
     | 
    
         
            +
                      <span class="method-name">[]</span><span class="method-args">(src_tgt)</span>
         
     | 
| 
      
 126 
     | 
    
         
            +
                      </a>
         
     | 
| 
      
 127 
     | 
    
         
            +
                    </div>
         
     | 
| 
      
 128 
     | 
    
         
            +
                  
         
     | 
| 
      
 129 
     | 
    
         
            +
                    <div class="method-description">
         
     | 
| 
      
 130 
     | 
    
         
            +
                      <p>
         
     | 
| 
      
 131 
     | 
    
         
            +
            The mappings hash is to be accessed not by a word-index but rather by a
         
     | 
| 
      
 132 
     | 
    
         
            +
            single key-value hash of {source => target_source} For example,
         
     | 
| 
      
 133 
     | 
    
         
            +
            mappings[@source_a => @source_b] should be set to a hash that represents
         
     | 
| 
      
 134 
     | 
    
         
            +
            the attribute mappings where @source_a‘s attributes are the keys and
         
     | 
| 
      
 135 
     | 
    
         
            +
            @source_b‘s attributes are the values.
         
     | 
| 
      
 136 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 137 
     | 
    
         
            +
                    </div>
         
     | 
| 
      
 138 
     | 
    
         
            +
                  </div>
         
     | 
| 
      
 139 
     | 
    
         
            +
             
     | 
| 
      
 140 
     | 
    
         
            +
                  <div id="method-M000027" class="method-detail">
         
     | 
| 
      
 141 
     | 
    
         
            +
                    <a name="M000027"></a>
         
     | 
| 
      
 142 
     | 
    
         
            +
             
     | 
| 
      
 143 
     | 
    
         
            +
                    <div class="method-heading">
         
     | 
| 
      
 144 
     | 
    
         
            +
                      <a href="Mappings.src/M000027.html" target="Code" class="method-signature"
         
     | 
| 
      
 145 
     | 
    
         
            +
                        onclick="popupCode('Mappings.src/M000027.html');return false;">
         
     | 
| 
      
 146 
     | 
    
         
            +
                      <span class="method-name">[]=</span><span class="method-args">(src_tgt, mapping)</span>
         
     | 
| 
      
 147 
     | 
    
         
            +
                      </a>
         
     | 
| 
      
 148 
     | 
    
         
            +
                    </div>
         
     | 
| 
      
 149 
     | 
    
         
            +
                  
         
     | 
| 
      
 150 
     | 
    
         
            +
                    <div class="method-description">
         
     | 
| 
      
 151 
     | 
    
         
            +
                      <p>
         
     | 
| 
      
 152 
     | 
    
         
            +
            See above.
         
     | 
| 
      
 153 
     | 
    
         
            +
            </p>
         
     | 
| 
      
 154 
     | 
    
         
            +
                    </div>
         
     | 
| 
      
 155 
     | 
    
         
            +
                  </div>
         
     | 
| 
      
 156 
     | 
    
         
            +
             
     | 
| 
      
 157 
     | 
    
         
            +
             
     | 
| 
      
 158 
     | 
    
         
            +
                </div>
         
     | 
| 
      
 159 
     | 
    
         
            +
             
     | 
| 
      
 160 
     | 
    
         
            +
             
     | 
| 
      
 161 
     | 
    
         
            +
              </div>
         
     | 
| 
      
 162 
     | 
    
         
            +
             
     | 
| 
      
 163 
     | 
    
         
            +
             
     | 
| 
      
 164 
     | 
    
         
            +
            <div id="validator-badges">
         
     | 
| 
      
 165 
     | 
    
         
            +
              <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
         
     | 
| 
      
 166 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 167 
     | 
    
         
            +
             
     | 
| 
      
 168 
     | 
    
         
            +
            </body>
         
     | 
| 
      
 169 
     | 
    
         
            +
            </html>
         
     |