Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/json/ld/extensions.rb

Instance Method Summary collapse

Instance Method Details

#opt_sort(ordered: false) ⇒ Array

Optionally order items

Parameters:

  • ordered (Boolean) (defaults to: false)

Returns:


50
51
52
# File 'lib/json/ld/extensions.rb', line 50

def opt_sort(ordered: false)
  ordered ? self.sort : self
end