Hexx::API
The syntax sugar to wrap module content to kind of public API.
Synopsis
require "hexx-api"
require_relative "my_module/add_foo.rb"
require_relative "my_module/add_bar.rb"
module MyModule
extend Hexx::API
api_method :add_foo, :AddFoo
api_method :add_bar, :AddBar, :build
end
MyModule[:add_foo]
MyModule.add_foo(*args)
MyModule[:add_bar]
MyModule.add_bar(*args)
Installation
Add this line to your application's Gemfile:
gem "hexx-api"
Then execute:
bundle
Or add it manually:
gem install hexx-api
Compatibility
Tested under rubies compatible to API 1.9.2+:
- MRI 1.9.3+
- Rubinius-2+ (modes 1.9+)
- JRuby-1.7+
Uses RSpec 3.0+ for testing and hexx-suit for dev/test tools collection.
License
See the MIT LICENSE.