Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nl_gas_stations

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nl_gas_stations

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Dutch Fuel Prices

Build Status Dependency Status Coverage Status Code Climate Inline docs

This gem provides easy access to the fuel prices for many gas stations in The Netherlands. Prices are taken from brandstofprijzen.info.

Installation

Add this line to your application's Gemfile:

gem 'nl_gas_stations'

And then execute:

bundle

Or install it yourself as:

gem install nl_gas_stations

Configuration

NlGasStations.configure do |config|
  # It is recommended to use a cache, to avoid flooding the source website with requests.
  # Leave this out of the configuration to not use the cache.
  # This must be a cache object (with read, write and fetch methods).
  config.cache = Rails.cache

  # If you are using the cache you can set a custom cache key prefix.
  # Default value: nl_gas_stations_
  # config.cache_prefix = 'custom_prefix'

  # Duration of how long data should be cached. Example: 14.days
  # Default value: 7.days
  config.cache_expires_in = 48.hours
end

Usage

Find multiple stations by providing a postal code (the numbers only), fuel type and an optional distance in kilometers. The default distance is 5 km. Distance must be 5, 10, 15 or 25.

The fuel type must be one of the following: :diesel, :euro_95, :lpg or :cng. Call NlGasStations.fuel_types to get all types returned as a hash.

# postal_code, fuel_type, distance
stations = NlGasStations.find_stations('1234', 'Euro 95', 15)

station_1 = stations.first
station_1[:gas_station][:name] #=> 'Gas Station Name Here'
station_1[:gas_station][:street_address] #=> 'Streetaddress 13a'
station_1[:gas_station][:postal_code] #=> '1234 AA'
station_1[:gas_station][:city] #=> 'AMSTERDAM'

station_1[:fuel_type] #=> :euro_95
station_1[:price] #=> 1.543
station_1[:date] #=> Date.new(2015, 2, 12)

Contributing

  1. Fork it ( https://github.com/[my-github-username]/nl_gas_stations/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

FAQs

Package last updated on 12 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc