Sha256: 581c16e5672d4c7c97fd90bb2f644e53e1eb80cac4ed9ec05e7711f7ac746870

Contents?: true

Size: 1.44 KB

Versions: 5

Compression:

Stored size: 1.44 KB

Contents

require 'active_model'
require 'active_support'
require 'active_support/core_ext/object/with_options'
require 'active_support/core_ext/string/inflections'
require 'active_support/json'
module ActiveModelSerializers
  extend ActiveSupport::Autoload
  autoload :Model
  autoload :Callbacks
  autoload :Deserialization
  autoload :SerializableResource
  autoload :Logging
  autoload :Test
  autoload :Adapter
  autoload :JsonPointer
  autoload :Deprecate
  autoload :LookupChain

  class << self; attr_accessor :logger; end
  self.logger = ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(STDOUT))

  def self.config
    ActiveModel::Serializer.config
  end

  # The file name and line number of the caller of the caller of this method.
  def self.location_of_caller
    caller[1] =~ /(.*?):(\d+).*?$/i
    file = Regexp.last_match(1)
    lineno = Regexp.last_match(2).to_i

    [file, lineno]
  end

  # Memoized default include directive
  # @return [JSONAPI::IncludeDirective]
  def self.default_include_directive
    @default_include_directive ||= JSONAPI::IncludeDirective.new(config.default_includes, allow_wildcard: true)
  end

  def self.silence_warnings
    original_verbose = $VERBOSE
    $VERBOSE = nil
    yield
  ensure
    $VERBOSE = original_verbose
  end

  require 'active_model/serializer/version'
  require 'active_model/serializer'
  require 'active_model/serializable_resource'
  require 'active_model_serializers/railtie' if defined?(::Rails)
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
active_model_serializers-0.10.6 lib/active_model_serializers.rb
active_model_serializers-0.10.5 lib/active_model_serializers.rb
agi_active_model_serializers-0.10.9 lib/active_model_serializers.rb
agi_active_model_serializers-0.10.8 lib/active_model_serializers.rb
agi_active_model_serializers-0.10.7 lib/active_model_serializers.rb