def serialize
      format = self.class.default_options[:format]
      if format.nil?
        to_serializable
      elsif format == :json
        to_serializable.to_json
      else
        fail FormatNotSupportedError
      end
    end
def serialize
      format = self.class.default_options[:format]
      if format.nil?
        to_serializable
      elsif format == :json
        to_serializable.to_json
      else
        fail FormatNotSupportedError
      end
    end
:category: Serialization

 Returns a text based representations.