class SgPostcode::Array
Public Class Methods
new(postcodes, opts = {})
click to toggle source
Init a new array object
@params
- postcodes: array[String] of postcode - opts: hash of option + response_type: default is :json, check the response folder + host: :Google is default, check services folder
# File lib/sg_postcode/array.rb, line 11 def initialize(postcodes, opts = {}) @postcodes = postcodes @opts = opts end
Public Instance Methods
convert()
click to toggle source
Convert to a long lat array
@return [{ long: ‘123456’, lat: ‘123456’ }, …]
@params
opts: list of options from #initializer
@example SgPostcode::Array.new(postcodes)
.convert
# File lib/sg_postcode/array.rb, line 26 def convert LongLatConverter.new(@postcodes, @opts).convert end