Sha256: 43e96c38b15c9a42511361bc5342a3fc4ecccca1b130064de3fc7ca080556184

Contents?: true

Size: 1.54 KB

Versions: 66

Compression:

Stored size: 1.54 KB

Contents

#
#  rhom_object.rb
#  rhodes
#
#  Copyright (C) 2008 Rhomobile, Inc. All rights reserved.
#
#  This program is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
module Rhom
  module RhomObject    
    def strip_braces(str=nil)
      str ? str.gsub(/\{/,"").gsub(/\}/,"") : nil
    end
  
    # use djb hash function to generate temp object id
    def djb_hash(str, len)
      hash = 5381
      for i in (0..len) 
        hash = ((hash << 5) + hash) + str[i].to_i
      end
      return hash
    end
    
    def extract_options(arr=[])
      arr.last.is_a?(Hash) ? arr.pop : {}
    end
    
    @@reserved_names = {"object" => "1",
                      "source_id" => "1",
                      "update_type" => "1",
                      "attrib_type" => "1",
                      "set_notification" => "1",
                      "clear_notification" => "1" }
    

    def RhomObject.method_name_reserved?(method)
      @@reserved_names.has_key?(method)
    end
  end # RhomObject
end # Rhom

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
rhodes-3.0.2 lib/framework/rhom/rhom_object.rb
rhodes-3.0.2.beta.1 lib/framework/rhom/rhom_object.rb
rhodes-3.0.1 lib/framework/rhom/rhom_object.rb
rhodes-3.0.1.beta.8 lib/framework/rhom/rhom_object.rb
rhodes-3.0.1.beta.7 lib/framework/rhom/rhom_object.rb
rhodes-3.0.1.beta.6 lib/framework/rhom/rhom_object.rb
rhodes-3.0.1.beta.5 lib/framework/rhom/rhom_object.rb
rhodes-3.0.1.beta.4 lib/framework/rhom/rhom_object.rb
rhodes-3.0.1.beta.3 lib/framework/rhom/rhom_object.rb
rhodes-3.0.1.beta.2 lib/framework/rhom/rhom_object.rb
rhodes-3.0.0 lib/framework/rhom/rhom_object.rb
rhodes-3.0.0.beta.7 lib/framework/rhom/rhom_object.rb
rhodes-3.0.0.beta.6 lib/framework/rhom/rhom_object.rb
rhodes-3.0.0.beta.5 lib/framework/rhom/rhom_object.rb
rhodes-3.0.0.beta.4 lib/framework/rhom/rhom_object.rb
rhodes-3.0.0.beta.3 lib/framework/rhom/rhom_object.rb
rhodes-3.0.0.beta.2 lib/framework/rhom/rhom_object.rb
rhodes-3.0.0.beta.1 lib/framework/rhom/rhom_object.rb
rhodes-2.4.1 lib/framework/rhom/rhom_object.rb
rhodes-2.4.1.beta.1 lib/framework/rhom/rhom_object.rb