Class: Qrcode::Waze::Code2Map
- Inherits:
-
Object
- Object
- Qrcode::Waze::Code2Map
- Defined in:
- lib/qrcode/waze.rb
Instance Method Summary collapse
- #create_googlemaps ⇒ Object
- #create_waze ⇒ Object
-
#initialize(address, size = 6, filename = 'qrcode.png') ⇒ Code2Map
constructor
A new instance of Code2Map.
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_googlemaps ⇒ Object
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_waze ⇒ Object
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 |