Roman Numeral Converter API - Ruby Gem

Roman Numeral Converter is a bidirectional tool for converting between Arabic numbers (1-3999) and Roman numerals. It provides detailed breakdowns of the conversion process.

Installation

Add this line to your application's Gemfile:

gem 'apiverve_romanconverter'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install apiverve_romanconverter

Getting Started

Get your API key at APIVerve

Basic Usage

require 'apiverve_romanconverter'

# Initialize the client
client = APIVerve::Romanconverter::Client.new(api_key: "YOUR_API_KEY")

# Make a request
response = client.execute({ number: 2024 })

# Print the response
puts response

Error Handling

begin
  response = client.execute({ number: 2024 })
  puts response["data"]
rescue APIVerve::Romanconverter::ValidationError => e
  puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Romanconverter::APIError => e
  puts "API error: #{e.message}"
  puts "Status code: #{e.status_code}"
end

Debug Mode

# Enable debug logging
client = APIVerve::Romanconverter::Client.new(
  api_key: "YOUR_API_KEY",
  debug: true
)

Example Response

{
  "status": "ok",
  "error": null,
  "data": {
    "number": 2024,
    "roman": "MMXXIV",
    "breakdown": {
      "M": 2,
      "X": 2,
      "IV": 1
    }
  }
}

Documentation

For more information, visit the API Documentation.

Support

License

This gem is available under the MIT License.