модуль 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 105 def self.cache_format_version Cache.format_version end
# File activesupport/lib/active_support.rb, line 109 def self.cache_format_version=(value) Cache.format_version = value end
# File activesupport/lib/active_support.rb, line 93 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 113 def self.to_time_preserves_timezone DateAndTime::Compatibility.preserve_timezone end
# File activesupport/lib/active_support.rb, line 117
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 8.0."
)
end
DateAndTime::Compatibility.preserve_timezone = value
end # File activesupport/lib/active_support.rb, line 127 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 131 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.