Class: Orthoses::ActiveSupport::TimeWithZone

Inherits:
Object
  • Object
show all
Defined in:
lib/orthoses/active_support/time_with_zone.rb

Instance Method Summary collapse

Constructor Details

#initialize(loader) ⇒ TimeWithZone

Returns a new instance of TimeWithZone.



6
7
8
# File 'lib/orthoses/active_support/time_with_zone.rb', line 6

def initialize(loader)
  @loader = loader
end

Instance Method Details

#callObject

Time <= (known Time) TimeWithZone <= (known TimeWithZone, known Time, core Time)



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/orthoses/active_support/time_with_zone.rb', line 12

def call
  store = @loader.call

  time_with_zone_store = store["ActiveSupport::TimeWithZone"]
  time_with_zone_store.body.replace(filter_decl(time_with_zone_store))
  each_line_from_core_time_definition(store) do |line|
    time_with_zone_store << line
  end

  store
end