Sha256: fb0f8fea238a8190567deb35ac9ed326ef430f0fa33c7d5fe5aece5775e72e03

Contents?: true

Size: 954 Bytes

Versions: 18

Compression:

Stored size: 954 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Support
    module Gems
      ##
      # @api private
      #
      class ActiveModel
        class << self
          ##
          # @return [Boolean]
          #
          # @internal
          #   `Style/TernaryParentheses` is disabled since `defined?` has too low priority without parentheses.
          #
          # rubocop:disable Style/TernaryParentheses
          def loaded?
            (defined? ::ActiveModel) ? true : false
          end
          # rubocop:enable Style/TernaryParentheses

          ##
          # @return [ConvenientService::Support::Version]
          #
          # @internal
          #   https://github.com/rails/rails/blob/main/activemodel/lib/active_model/version.rb
          #
          def version
            loaded? ? Support::Version.new(::ActiveModel.version) : Support::Version.null_version
          end
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
convenient_service-0.18.0 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.17.0 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.16.0 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.15.0 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.14.0 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.13.0 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.12.0 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.11.0 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.10.1 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.10.0 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.9.0 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.8.0 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.7.0 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.6.0 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.5.0 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.4.0 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.3.1 lib/convenient_service/support/gems/active_model.rb
convenient_service-0.3.0 lib/convenient_service/support/gems/active_model.rb