Class: Time
- Defined in:
- lib/active_support/refinements/core_ext/time/marshal.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
._load(marshaled_time) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/active_support/refinements/core_ext/time/marshal.rb', line 8 def _load(marshaled_time) time = _load_without_zone(marshaled_time) time.instance_eval do if zone = defined?(@_zone) && remove_instance_variable('@_zone') ary = to_a ary[0] += subsec if ary[0] == sec ary[-1] = zone utc? ? Time.utc(*ary) : Time.local(*ary) else self end end end |
._load_without_zone ⇒ Object
7 |
# File 'lib/active_support/refinements/core_ext/time/marshal.rb', line 7 alias_method :_load_without_zone, :_load |
Instance Method Details
#_dump(*args) ⇒ Object
24 25 26 27 28 |
# File 'lib/active_support/refinements/core_ext/time/marshal.rb', line 24 def _dump(*args) obj = dup obj.instance_variable_set('@_zone', zone) obj._dump_without_zone(*args) end |
#_dump_without_zone ⇒ Object
23 |
# File 'lib/active_support/refinements/core_ext/time/marshal.rb', line 23 alias_method :_dump_without_zone, :_dump |