Sha256: e24de50b30b3893427046137b6d405e13d4c1e60b2e63f8468662d8840b96e9b

Contents?: true

Size: 394 Bytes

Versions: 6

Compression:

Stored size: 394 Bytes

Contents

module Enumerable
  #Scopes on models generate Arrays
  #this method enables short call to the json creation for all elements in the array
  def to_gmaps4rails(&block)
    output = "["
    json_array = []
    each do |object|
      json = Gmaps4rails.create_json(object, &block)
      json_array << json.to_s unless json.nil?
    end
    output << json_array * (",")
    output << "]"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gmaps4rails-1.5.7 lib/gmaps4rails/extensions/enumerable.rb
gmaps4rails-2.0.0.pre lib/gmaps4rails/extensions/enumerable.rb
gmaps4rails-1.5.6 lib/gmaps4rails/extensions/enumerable.rb
gmaps4rails-1.5.5 lib/gmaps4rails/extensions/enumerable.rb
gmaps4rails-1.5.4 lib/gmaps4rails/extensions/enumerable.rb
gmaps4rails-1.5.3 lib/gmaps4rails/extensions/enumerable.rb