Module: Quintype::API::BaseFunctions

Defined in:
lib/quintype/api/base_functions.rb

Defined Under Namespace

Modules: ClassFunctions

Class Method Summary collapse

Class Method Details

.included(clazz) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/quintype/api/base_functions.rb', line 29

def self.included(clazz)
  clazz.extend(ClassFunctions)
  clazz.members_as_string.each do |hypenated_key|
    underscore_key = hypenated_key.gsub(/-/, '_')
    clazz.send(:alias_method, underscore_key, hypenated_key) if underscore_key != hypenated_key
  end
end