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:



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

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