lib/daylight/api.rb
##
# Alias the configured client API constants to be references without a
# version number for the active version:
#
# For example, if the active version is 'v1':
#
#     API::Post   # => API::V1::Post
#
# Assumes all your model classes are loaded (defined)
Alias the configured client API constants to be references without a
version number for the active version.

For example, if the active version is 'v1'.



Assumes all your model classes are loaded (defined)
Alias the configured client API constants to be references without a version number for the active version . For example if the active version is ' v1 ' . Assumes all your model classes are loaded ( defined )
def alias_apis
        api_classes   = "#{namespace}::#{version}".constantize.constants
        api_namespace = namespace.constantize
        api_classes.each do |api_class|
          api_namespace.const_set(api_class, "#{namespace}::#{version}::#{api_class}".constantize)
        end
        true
      rescue => e
        logger.error("Could not alias_apis #{e.class}:\n\t#{e.message}") if logger
        false
      end
def alias_apis api_classes = "#{namespace}::#{version}" . constantize . constants api_namespace = namespace . constantize api_classes . each do | api_class | api_namespace . const_set ( api_class , "#{namespace}::#{version}::#{api_class}" . constantize ) end true rescue => e logger . error ( "Could not alias_apis #{e.class}:\n\t#{e.message}" ) if logger false end
Alias the configured client API constants to be references without a
version number for the active version:
Alias the configured client API constants to be references without a version number for the active version :