Sha256: 3ca7ff0dc4de86c428fe0fb9be03f1aaffd4190906cb63e96bf05b8f086214b4

Contents?: true

Size: 288 Bytes

Versions: 13

Compression:

Stored size: 288 Bytes

Contents

class Time
  def encode_with(coder)
    label =
      if utc?
        usec.zero? ? '%Y-%m-%d %H:%M:%S Z' : '%Y-%m-%d %H:%M:%S.%9N Z'
      else
        usec.zero? ? '%Y-%m-%d %H:%M:%S %:z' : '%Y-%m-%d %H:%M:%S.%9N %:z'
      end

    coder.represent_scalar(nil, strftime(label))
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
siteleaf-1.0.11 lib/patches/time_with_zone_encode_with.rb
siteleaf-1.0.10 lib/patches/time_with_zone_encode_with.rb
siteleaf-1.0.9 lib/patches/time_with_zone_encode_with.rb
siteleaf-1.0.8 lib/patches/time_with_zone_encode_with.rb
siteleaf-1.0.7 lib/patches/time_with_zone_encode_with.rb
siteleaf-1.0.6 lib/patches/time_with_zone_encode_with.rb
siteleaf-1.0.5 lib/patches/time_with_zone_encode_with.rb
siteleaf-1.0.4 lib/patches/time_with_zone_encode_with.rb
siteleaf-1.0.3 lib/patches/time_with_zone_encode_with.rb
siteleaf-1.0.2 lib/patches/time_with_zone_encode_with.rb
siteleaf-1.0.1 lib/patches/time_with_zone_encode_with.rb
siteleaf-1.0.0 lib/patches/time_with_zone_encode_with.rb
siteleaf-2.0.0.pre.beta7 lib/patches/time_with_zone_encode_with.rb