Sha256: b82935f296adcd70fc91948523685538f1d302d315b7284f530a6eb5d659a1f6

Contents?: true

Size: 544 Bytes

Versions: 2

Compression:

Stored size: 544 Bytes

Contents

class Shoes
  module Common
    module Registration
      def apps
        @apps ||= []
        @apps.dup
      end

      def register(app)
        register_main_app app
        apps && @apps << app
      end

      def unregister(app)
        apps && @apps.delete(app)
      end

      def unregister_all
        @main_app = nil
        @apps = []
      end

      def main_app
        @main_app
      end

      # Registers the first app as the main app
      def register_main_app(app)
        @main_app ||= app
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
shoes-dsl-4.0.0.pre2 lib/shoes/common/registration.rb
shoes-4.0.0.pre1 lib/shoes/common/registration.rb