Acronym Generator API - Ruby Gem
Acronym Generator creates acronyms from phrases by extracting the first letter of each word. Input 'Application Programming Interface' and get 'API'.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_acronymgenerator'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_acronymgenerator
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_acronymgenerator'
# Initialize the client
client = APIVerve::Acronymgenerator::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({ text: "Application Programming Interface" })
# Print the response
puts response
Error Handling
begin
response = client.execute({ text: "Application Programming Interface" })
puts response["data"]
rescue APIVerve::Acronymgenerator::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Acronymgenerator::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Acronymgenerator::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"text": "Application Programming Interface",
"acronyms": [
"API",
"APP IN",
"Accessing Program's Interface"
]
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://apiverve.com/marketplace/acronymgenerator?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.