Module: NestedText::ToNTMixin

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.

Instance Method Summary collapse

Instance Method Details

#to_nt(**kwargs) ⇒ Object

Encode this object to a NestedText string.

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



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

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