Module: ROM::LDAP::Relation::Exporting

Included in:
ROM::LDAP::Relation
Defined in:
lib/rom/ldap/relation/exporting.rb

Overview

LDIF, JSON, YAML and if loading extensions MsgPack and DSML.

Instance Method Summary collapse

Instance Method Details

#to_json(_opts = nil) ⇒ String

Export the relation as JSON

Examples:

relation.to_json
JSON.generate(relation)

Parameters:

  • _opts (Mixed) (defaults to: nil)

    compatibility with JSON.generate

Returns:

  • (String)


39
40
41
# File 'lib/rom/ldap/relation/exporting.rb', line 39

def to_json(_opts = nil)
  export.to_json
end

#to_ldifString

Export the relation as LDIF

Examples:

relation.to_ldif

Returns:

  • (String)


24
25
26
# File 'lib/rom/ldap/relation/exporting.rb', line 24

def to_ldif
  export.to_ldif
end

#to_yamlString

Export the relation as YAML

Examples:

relation.to_yaml

Returns:

  • (String)


51
52
53
# File 'lib/rom/ldap/relation/exporting.rb', line 51

def to_yaml
  export.to_yaml
end