Class: MapPrint::Providers::Base
- Inherits:
-
Object
- Object
- MapPrint::Providers::Base
- Defined in:
- lib/map_print/providers/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#north_east ⇒ Object
Returns the value of attribute north_east.
-
#provider ⇒ Object
Returns the value of attribute provider.
-
#south_west ⇒ Object
Returns the value of attribute south_west.
-
#zoom ⇒ Object
Returns the value of attribute zoom.
Instance Method Summary collapse
- #build_provider(base_url = nil) ⇒ Object
- #download ⇒ Object
-
#initialize(south_west, north_east, zoom, base_url = nil) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(south_west, north_east, zoom, base_url = nil) ⇒ Base
Returns a new instance of Base.
9 10 11 12 |
# File 'lib/map_print/providers/base.rb', line 9 def initialize(south_west, north_east, zoom, base_url=nil) @south_west, @north_east, @zoom = south_west, north_east, zoom @provider = build_provider(base_url) end |
Instance Attribute Details
#north_east ⇒ Object
Returns the value of attribute north_east.
7 8 9 |
# File 'lib/map_print/providers/base.rb', line 7 def north_east @north_east end |
#provider ⇒ Object
Returns the value of attribute provider.
7 8 9 |
# File 'lib/map_print/providers/base.rb', line 7 def provider @provider end |
#south_west ⇒ Object
Returns the value of attribute south_west.
7 8 9 |
# File 'lib/map_print/providers/base.rb', line 7 def south_west @south_west end |
#zoom ⇒ Object
Returns the value of attribute zoom.
7 8 9 |
# File 'lib/map_print/providers/base.rb', line 7 def zoom @zoom end |
Instance Method Details
#build_provider(base_url = nil) ⇒ Object
14 15 16 |
# File 'lib/map_print/providers/base.rb', line 14 def build_provider(base_url = nil) raise 'SubClasses must override this method' end |
#download ⇒ Object
18 19 20 21 22 |
# File 'lib/map_print/providers/base.rb', line 18 def download provider.download to_image end |