compiler_activesupporttimeext.md
August 6, 2025 ยท View on GitHub
ActiveSupportTimeExt
Tapioca::Dsl::Compilers::ActiveSupportTimeExt generates an RBI file for the Time#current method
defined by Active Support's Time extensions.
If Time.zone or config.time_zone are set, then the Time.current method will be defined as returning
an instance of ActiveSupport::TimeWithZone, otherwise it will return an instance of Time.
For an application that is configured with:
config.time_zone = "UTC"
this compiler will produce the following RBI file:
class Time
class << self
sig { returns(::ActiveSupport::TimeWithZone) }
def current; end
end
end
whereas if Time.zone and config.time_zone are not set, it will produce:
class Time
class << self
sig { returns(::Time) }
def current; end
end
end