модуль ActiveSupport
Active Support — классы-утилиты и расширения Ruby из Rails
Active Support — это набор классов-утилит и расширений стандартной библиотеки, которые оказались полезны для фреймворка Rails. Эти дополнения входят в этот пакет, чтобы их можно было при необходимости загружать в проектах Ruby вне Rails.
Подробнее о расширениях можно прочитать в руководстве Основные расширения Active Support.
Загрузка и установка
Последнюю версию Active Support можно установить с помощью RubyGems:
$ gem install activesupport
Исходный код можно загрузить в составе проекта Rails на GitHub:
Лицензия
Active Support распространяется по лицензии MIT:
Поддержка
Документация API доступна по адресу:
Сообщения об ошибках в проекте Ruby on Rails можно отправлять сюда:
Предложения по новым функциям следует обсуждать на форуме rubyonrails-core здесь:
Общедоступные методы класса
# File activesupport/lib/active_support.rb, line 116 def self.cache_format_version Cache.format_version end
# File activesupport/lib/active_support.rb, line 120 def self.cache_format_version=(value) Cache.format_version = value end
# File activesupport/lib/active_support.rb, line 98 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 124
def self.to_time_preserves_timezone
ActiveSupport.deprecator.warn(
"`config.active_support.to_time_preserves_timezone` is deprecated and will be removed in Rails 8.2"
)
@to_time_preserves_timezone
end # File activesupport/lib/active_support.rb, line 131
def self.to_time_preserves_timezone=(value)
ActiveSupport.deprecator.warn(
"`config.active_support.to_time_preserves_timezone` is deprecated and will be removed in Rails 8.2"
)
@to_time_preserves_timezone = value
end # File activesupport/lib/active_support.rb, line 139 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 143 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.