New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dof

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dof

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

DOF

A simple gem to interact with the Mexican DOF open data service

Installation

Add this line to your application's Gemfile:

gem 'dof'

And then execute:

$ bundle

Or install it yourself as:

$ gem install dof

Usage

Add a new initializer and add the following lines

require "DOF"

DOF.config do |c|
  c.base_uri = "https://sidofqa.segob.gob.mx/dof/sidof/"
end

Querying the current USD exchange rate

To get the current (daily) exchange rate call USD_exchange_rate

DOF::Indicator.USD_exchange_rate

This will return an RequestResponse object with the following attributes:

# An array of indicator objects
:indicators
# A request response confirmation
:response_code
# response status eg: 200/500
:response_status
# number of indicators found
:total_indicators

Querying the current UDIS exchange rate

To get the current (daily) exchange rate call UDIS_exchange_rate

DOF::Indicator.UDIS_exchange_rate

Querying indicators by date range

You can call USD_exchange_rate and UDIS_exchange_rate with date params

DOF::Indicator.USD_exchange_rate(date: initial_date, end_date: end_date)

The accepted date formats are:

  • String in mm/dd/YYYY format
  • String in mm-dd-YYYY format
  • String in mm.dd.YYYY format
  • Date type, eg: Date.today

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/yellowme/DOF.

FAQs

Package last updated on 08 Oct 2020

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