Module: ForeignModel

Defined in:
lib/foreign_model.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

SCOPE_PROCS =
{}

Class Method Summary collapse

Class Method Details

.camelize(str) ⇒ Object



9
10
11
# File 'lib/foreign_model.rb', line 9

def self.camelize(str)
  str.to_s.gsub(/\/(.?)/) { "::" + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase }
end

.included(base) ⇒ Object



4
5
6
7
# File 'lib/foreign_model.rb', line 4

def self.included(base)
  SCOPE_PROCS[base] ||= {}
  base.extend ClassMethods
end