Module: NestedText::NTEncodeMixin

Included in:
Array, Hash, NilClass, String
Defined in:
lib/nestedtext/encode_helpers.rb

Overview

A mixin for Custom Classes to get the to_nt shortcut. TODO rename to: ToNTMixin

Instance Method Summary collapse

Instance Method Details

#to_nt(**kwargs) ⇒ Object

Encode this object to a NestedText string.

This method takes the same arguments as NestedText::dump.



10
11
12
# File 'lib/nestedtext/encode_helpers.rb', line 10

def to_nt(**kwargs)
  NestedText.dump(self, strict: false, **kwargs)
end