Registry / utility / hash-keyword-args

hash-keyword-args

JSON →
library0.1.1rbrubygemsunverified

Makes it easier and more robust to use a hash for keyword args to a method, performing argument checking and default values.

gem install hash_keyword_args
INSTALL
IMPORT
SIG · HASH-KEYWORD-ARGS
H
hash-keyword-args
utilityrubyv0.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HashKeywordArgs
require 'hash_keyword_args'

Use a hash for keyword arguments with defaults and validation.

require 'hash_keyword_args' class MyClass include HashKeywordArgs def initialize(opts = {}) process_keyword_args(opts, defaults: {name: 'World'}) @name = opts[:name] end end MyClass.new(name: 'Ruby')
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.1.1latest on RubyGems
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
hash-keyword-args — gem install hash-keyword-args · libregistry