Sha256: a1ccd1ad5348560c468803e388fe53c3d0368df75a85538f734eb6533b4bc6d8

Contents?: true

Size: 962 Bytes

Versions: 2

Compression:

Stored size: 962 Bytes

Contents

module Cartographie
  module Config
    extend self

    def configure
      yield self
    end

    def api_endpoint
      OPTIONS[:api_endpoint]
    end

    def width
      OPTIONS[:width]
    end

    def width=(value)
      OPTIONS[:width] = value
    end

    def height
      OPTIONS[:height]
    end

    def height=(value)
      OPTIONS[:height] = value
    end

    def zoom
      OPTIONS[:zoom]
    end

    def zoom=(value)
      OPTIONS[:zoom] = value
    end

    def file_format
      OPTIONS[:file_format]
    end

    def file_format=(value)
      OPTIONS[:file_format] = value
    end

    def sensor
      OPTIONS[:sensor]
    end

    def sensor=(value)
      OPTIONS[:sensor] = value
    end

    private

    DEFAULTS = {
      api_endpoint: 'http://maps.googleapis.com/maps/api/staticmap',
      width: 300,
      height: 300,
      zoom: 15,
      file_format: 'png',
      sensor: false
    }
    OPTIONS = {}.merge!(DEFAULTS)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cartographie-0.0.3 lib/cartographie/config.rb
cartographie-0.0.2 lib/cartographie/config.rb