модуль ActiveSupport
Active Support – Утилитарные классы и расширения Ruby из Rails
Active Support — это набор утилитарных классов и расширений стандартной библиотеки Ruby, которые оказались полезными для фреймворка Rails. Эти добавления находятся в этом пакете, чтобы их можно было загружать по мере необходимости в проектах Ruby вне Rails.
Подробнее об расширениях можно прочитать в руководстве Active Support Core Extensions.
Загрузка и установка
Последнюю версию Active Support можно установить с помощью RubyGems:
$ gem install activesupport
Исходный код можно загрузить как часть проекта Rails на GitHub:
Лицензия
Active Support выпущен под лицензией MIT:
Поддержка
Документация API находится по адресу:
Отчеты об ошибках для проекта Ruby on Rails можно подать здесь:
Заявки на новые функции следует обсудить на списке рассылки rails-core по адресу:
Методы публичного класса
# File activesupport/lib/active_support.rb, line 104 def self.cache_format_version Cache.format_version end
# File activesupport/lib/active_support.rb, line 108 def self.cache_format_version=(value) Cache.format_version = value end
# File activesupport/lib/active_support.rb, line 92 def self.eager_load! super NumberHelper.eager_load! end
# File activesupport/lib/active_support/gem_version.rb, line 5 def self.gem_version Gem::Version.new VERSION::STRING end
Возвращает текущую загруженную версию Active Support в виде Gem::Version.
# File activesupport/lib/active_support.rb, line 112 def self.to_time_preserves_timezone DateAndTime::Compatibility.preserve_timezone end
# File activesupport/lib/active_support.rb, line 116
def self.to_time_preserves_timezone=(value)
unless value
ActiveSupport.deprecator.warn(
"Support for the pre-Ruby 2.4 behavior of to_time has been deprecated and will be removed in Rails 7.2."
)
end
DateAndTime::Compatibility.preserve_timezone = value
end # File activesupport/lib/active_support.rb, line 126 def self.utc_to_local_returns_utc_offset_times DateAndTime::Compatibility.utc_to_local_returns_utc_offset_times end
# File activesupport/lib/active_support.rb, line 130 def self.utc_to_local_returns_utc_offset_times=(value) DateAndTime::Compatibility.utc_to_local_returns_utc_offset_times = value end
# 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.