Tense Converter API - Ruby Gem

Tense Converter is a simple tool for converting text to past or future tense. It returns the text converted to the specified tense.

Installation

Add this line to your application's Gemfile:

gem 'apiverve_tenseconverter'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install apiverve_tenseconverter

Getting Started

Get your API key at APIVerve

Basic Usage

require 'apiverve_tenseconverter'

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

# Make a request
response = client.execute({
  text: "I am walking down the street, and I can see a dog",
  tense: "past"
})

# Print the response
puts response

Error Handling

begin
  response = client.execute({ text: "I am walking down the street, and I can see a dog", tense: "past" })
  puts response["data"]
rescue APIVerve::Tenseconverter::ValidationError => e
  puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Tenseconverter::APIError => e
  puts "API error: #{e.message}"
  puts "Status code: #{e.status_code}"
end

Debug Mode

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

Example Response

{
  "status": "ok",
  "error": null,
  "data": {
    "tense": "past",
    "result": "I was walking down the street, and I could see a dog",
    "changed": true
  }
}

Documentation

For more information, visit the API Documentation.

Support

License

This gem is available under the MIT License.