Class: Enumerator

Inherits:
Object
  • Object
show all
Defined in:
lib/json_enum.rb

Instance Method Summary collapse

Instance Method Details

#to_jsonObject


4
5
6
7
8
# File 'lib/json_enum.rb', line 4

def to_json
  '[' << each.with_object('') do |e, s|
    s << "#{s.empty? ? '' : ','}" << e.to_json
  end << ']'
end