class GalterIrExporter::Export::Converter
a base class to convert an ActiveFedora object that contains permissions and allow for pretty json.
Public Instance Methods
to_json(options = {})
click to toggle source
overrides to_json
to optionally allow for a pretty version of the json to be outputted
@param [Boolean] pretty pass true to output formatted json using pretty_generate
Calls superclass method
# 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
Private Instance Methods
permissions(object)
click to toggle source
# File lib/galter_ir_exporter/export/converter.rb, line 18 def permissions(object) object.permissions.map { |p| PermissionConverter.new(p) } end