Class: GalterIrExporter::Export::Converter

Inherits:
Object
  • Object
show all
Defined in:
lib/galter_ir_exporter/export/converter.rb

Overview

a base class to convert an ActiveFedora object that contains permissions and allow for pretty json.

Direct Known Subclasses

CollectionConverter, GenericFileConverter

Instance Method Summary collapse

Instance Method Details

#to_json(options = {}) ⇒ Object

overrides to_json to optionally allow for a pretty version of the json to be outputted

Parameters:

  • pretty (Boolean)

    pass true to output formatted json using pretty_generate



9
10
11
12
13
14
# File 'lib/galter_ir_exporter/export/converter.rb', line 9

def to_json(options = {})
  pretty = options.delete(:pretty)
  json = super
  return json unless pretty
  JSON.pretty_generate(JSON.parse(json))
end