Sha256: c2e8fb5be80f1b85036dc4c07d318e681793c8752d11863f133620942b40197c

Contents?: true

Size: 752 Bytes

Versions: 2

Compression:

Stored size: 752 Bytes

Contents

module Troles::Common
  module Api
    autoload :Core,       'troles/common/api/core'
    autoload :Cache,      'troles/common/api/cache'
    autoload :Config,     'troles/common/api/config'
    autoload :Event,      'troles/common/api/event'
    autoload :Read,       'troles/common/api/read'
    autoload :Write,      'troles/common/api/write'
    autoload :Validation, 'troles/common/api/validation'


    module ClassMethods
      def apis
        [:core, :cache, :config, :event, :read, :validation, :write]
      end

      def included(base)
        apis.each do |api|
          begin
            base.include_and_extend :"#{api.to_s.camelize}"
          rescue
          end
        end      
      end
    end
    extend ClassMethods
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
troles-0.5.1 lib/troles/common/api.rb
troles-0.5.0 lib/troles/common/api.rb