Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hexx-api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexx-api

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Hexx::API

Gem Version Build Status Dependency Status Code Climate Coverage Inline docs

The syntax sugar to wrap module content to kind of public API.

Synopsis

# lib/my_module.rb
require "hexx-api"

# Load the code of the module (including some services)
require_relative "my_module/add_foo.rb"
require_relative "my_module/add_bar.rb"
# ...

# Provides public API for the module
module MyModule
  extend Hexx::API

  api_method :add_foo, :AddFoo  # :new is the default method
  api_method :add_bar, :AddBar, :build
end
MyModule[:add_foo]
# => Foo

MyModule.add_foo(*args)
# This is the same as AddFoo.new(*args)

MyModule[:add_bar]
# => Bar

MyModule.add_bar(*args)
# This is the same as AddBar.build(*args)

Installation

Add this line to your application's Gemfile:

# 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.

FAQs

Package last updated on 25 Apr 2015

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