Sha256: 87956241faf13da69c42fdc00baa57f9acb23438a81fe3f244ff8b99105dc593

Contents?: true

Size: 518 Bytes

Versions: 1

Compression:

Stored size: 518 Bytes

Contents

# frozen_string_literal: true

module KO
  class Application < Object
    # rubocop:disable Style/GlobalVars
    class << self
      def instance = $_KO_APP
    end

    def initialize(id: nil)
      begin
        super(id: id || "app")
      rescue InvalidParent
        @parent = nil
      end
      raise AlreadyIitialized if $_KO_APP

      $_KO_APP = self
    end
    # rubocop:enable Style/GlobalVars

    def parent=(_obj)
      raise KO::InvalidParent, "KO::Application cannot have a parent"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ko-0.1.2 lib/ko/application.rb