Spec-Zone.ru › Ruby on Rails 8.0

module ActiveSupport

Active Support – Утилитарные классы и расширения Ruby из Rails

Active Support — это набор утилитарных классов и расширений стандартной библиотеки Ruby, которые оказались полезными для фреймворка Rails. Эти добавления находятся в этом пакете, чтобы их можно было загружать по мере необходимости в проектах Ruby вне Rails.

Подробнее об расширениях можно узнать в руководстве Active Support Core Extensions.

Загрузка и установка

Последнюю версию Active Support можно установить с помощью RubyGems:

$ gem install activesupport

Исходный код можно загрузить как часть проекта Rails на GitHub:

  • github.com/rails/rails/tree/main/activesupport

Лицензия

Active Support распространяется под лицензией MIT:

  • opensource.org/licenses/MIT

Поддержка

Документация API находится по адресу:

  • api.rubyonrails.org

Отчёты об ошибках для проекта Ruby on Rails можно отправить сюда:

  • github.com/rails/rails/issues

Заявки на новые функции следует обсуждать на списке рассылки rails-core здесь:

  • discuss.rubyonrails.org/c/rubyonrails-core

Публичные методы класса

cache_format_version() Показать исходный код
# File activesupport/lib/active_support.rb, line 106
def self.cache_format_version
  Cache.format_version
end
cache_format_version=(value) Показать исходный код
# File activesupport/lib/active_support.rb, line 110
def self.cache_format_version=(value)
  Cache.format_version = value
end
eager_load!() Показать исходный код
# File activesupport/lib/active_support.rb, line 94
def self.eager_load!
  super

  NumberHelper.eager_load!
end
Вызывает метод суперкласса
gem_version() Показать исходный код
# File activesupport/lib/active_support/gem_version.rb, line 5
def self.gem_version
  Gem::Version.new VERSION::STRING
end

Возвращает текущую загруженную версию Active Support в виде Gem::Version.

to_time_preserves_timezone() Показать исходный код
# File activesupport/lib/active_support.rb, line 114
def self.to_time_preserves_timezone
  DateAndTime::Compatibility.preserve_timezone
end
to_time_preserves_timezone=(value) Показать исходный код
# File activesupport/lib/active_support.rb, line 118
def self.to_time_preserves_timezone=(value)
  if !value
    ActiveSupport.deprecator.warn(
      "`to_time` will always preserve the receiver timezone rather than system local time in Rails 8.1. " \
      "To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`."
    )
  elsif value != :zone
    ActiveSupport.deprecator.warn(
      "`to_time` will always preserve the full timezone rather than offset of the receiver in Rails 8.1. " \
      "To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`."
    )
  end

  DateAndTime::Compatibility.preserve_timezone = value
end
utc_to_local_returns_utc_offset_times() Показать исходный код
# File activesupport/lib/active_support.rb, line 134
def self.utc_to_local_returns_utc_offset_times
  DateAndTime::Compatibility.utc_to_local_returns_utc_offset_times
end
utc_to_local_returns_utc_offset_times=(value) Показать исходный код
# File activesupport/lib/active_support.rb, line 138
def self.utc_to_local_returns_utc_offset_times=(value)
  DateAndTime::Compatibility.utc_to_local_returns_utc_offset_times = value
end
version() Показать исходный код
# File activesupport/lib/active_support/version.rb, line 7
def self.version
  gem_version
end

Возвращает текущую загруженную версию Active Support в виде Gem::Version.

© 2004–2021 David Heinemeier Hansson
Licensed under the MIT License.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API