Sha256: 7cbe32159a4b17e9d708478519179e36c6dcb822229009cf987a1142b5cfa8c4

Contents?: true

Size: 785 Bytes

Versions: 12

Compression:

Stored size: 785 Bytes

Contents

# frozen_string_literal: true

require "pakyow/environment"

module Pakyow
  # Base framework class.
  #
  class Framework
    class << self
      # rubocop:disable Naming/MethodName
      def Framework(name)
        Class.new(self) do
          @framework_name = name
        end
      end
      # rubocop:enabled Naming/MethodName

      def inherited(framework_class)
        super

        return unless instance_variable_defined?(:@framework_name)
        Pakyow.register_framework(@framework_name, framework_class)
      end
    end

    context = self
    Pakyow.singleton_class.class_eval do
      define_method :Framework do |name|
        context.Framework(name)
      end
    end

    attr_reader :object

    def initialize(object)
      @object = object
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pakyow-core-1.0.6 lib/pakyow/framework.rb
pakyow-core-1.0.5 lib/pakyow/framework.rb
pakyow-core-1.0.4 lib/pakyow/framework.rb
pakyow-core-1.0.3 lib/pakyow/framework.rb
pakyow-core-1.0.2 lib/pakyow/framework.rb
pakyow-core-1.0.1 lib/pakyow/framework.rb
pakyow-core-1.0.0 lib/pakyow/framework.rb
pakyow-core-1.0.0.rc5 lib/pakyow/framework.rb
pakyow-core-1.0.0.rc4 lib/pakyow/framework.rb
pakyow-core-1.0.0.rc3 lib/pakyow/framework.rb
pakyow-core-1.0.0.rc2 lib/pakyow/framework.rb
pakyow-core-1.0.0.rc1 lib/pakyow/framework.rb