Class: Qrcode::Waze::Code2Map

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

Instance Method Summary collapse

Constructor Details

#initialize(address, size = 6, filename = 'qrcode.png') ⇒ Code2Map

Returns a new instance of Code2Map.



10
11
12
13
14
# File 'lib/qrcode/waze.rb', line 10

def initialize(address, size = 6, filename = 'qrcode.png')
	@address = address
	@filename = filename
	@size = size
end

Instance Method Details

#create_googlemapsObject



20
21
22
# File 'lib/qrcode/waze.rb', line 20

def create_googlemaps
	RQRCode::QRCode.new("http://maps.google.com/maps?f=d&daddr=#{@address.gsub!(' ','+')}&directionsmode=transit").as_png(:module_size => @size).save(@filename) if !@address.nil? and !@filename.nil? and !@size.nil?
end

#create_wazeObject



16
17
18
# File 'lib/qrcode/waze.rb', line 16

def create_waze
	RQRCode::QRCode.new("http://waze.to/?q=#{@address.gsub!(' ','%20')}&navigate=yes").as_png(:module_size => @size).save(@filename) if !@address.nil? and !@filename.nil? and !@size.nil?
end