mrblib/mrb_malba.rb
def serialize(with: nil)
        serializer = case with
                     when nil
                       @_serializer || empty_serializer
                     when ->(obj) { obj.is_a?(Class) && obj <= Malba::Serializer }
                       with
                     when Proc
                       inline_extended_serializer(with)
                     else
                       raise ArgumentError, 'Unexpected type for with, possible types are Class or Proc'
                     end
        serializer.new(self).serialize
      end
# Get serializer with `with` argument and serialize self with it
#
# @param with [nil, Proc, Malba::Serializer] selializer
# @return [String] serialized JSON string
Get serializer with `with` argument and serialize self with it
Get serializer with ` with ` argument and serialize self with it
def serialize(with: nil)
        serializer = case with
                     when nil
                       @_serializer || empty_serializer
                     when ->(obj) { obj.is_a?(Class) && obj <= Malba::Serializer }
                       with
                     when Proc
                       inline_extended_serializer(with)
                     else
                       raise ArgumentError, 'Unexpected type for with, possible types are Class or Proc'
                     end
        serializer.new(self).serialize
      end
def serialize ( with : nil ) serializer = case with when nil @_serializer || empty_serializer when -> ( obj ) { obj . is_a? ( Class ) && obj <= Malba :: Serializer } with when Proc inline_extended_serializer ( with ) else raise ArgumentError , 'Unexpected type for with, possible types are Class or Proc' end serializer . new ( self ) . serialize end
Get serializer with `with` argument and serialize self with it
Get serializer with ` with ` argument and serialize self with it
serialized JSON string
serialized JSON string
String
with
None