Sha256: 5f94e36d44db9ebc40f571eafc27075a56443fd99fe059b9ef187a92534d7ecb
Contents?: true
Size: 330 Bytes
Versions: 2
Compression:
Stored size: 330 Bytes
Contents
class Array #Scopes on models generate Arrays #this method enables short call to the json creation for all elements in the array def to_gmaps4rails(&block) json = "[" each do |object| json << Gmaps4rails.create_json(object, &block).to_s end json.chop!.chop! unless json == "[" json << "]" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
gmaps4rails-1.3.2 | lib/gmaps4rails/extensions/array.rb |
gmaps4rails-1.3.1 | lib/gmaps4rails/extensions/array.rb |