Sha256: 0de8d61138de3906aeef790b6f139eae3f89f707b5fb5a28cdbc57fff0cc5a46

Contents?: true

Size: 344 Bytes

Versions: 1

Compression:

Stored size: 344 Bytes

Contents

# frozen_string_literal: true

module Minutely
  ##
  # A mixin to use #to_s as JSON representation of the including object.
  module StringAsJson
    ##
    # The JSON representation of the object as Hash. Conventionally used by
    # common serializers.
    #
    # @return [Hash]
    def as_json(_options = nil)
      to_s
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
minutely-3.0.0 lib/minutely/string_as_json.rb