Sha256: c85703402d3b84577be9c24b9e0eddfdeb6ed1f6100b16b2f4b0f2a25ce3ad06
Contents?: true
Size: 663 Bytes
Versions: 6
Compression:
Stored size: 663 Bytes
Contents
require 'ns-options/root_methods' require 'ns-options/proxy' module NsOptions def self.included(receiver) receiver.class_eval { extend NsOptions::DSL } end module DSL # This is the main DSL method for creating a namespace of options for your # class/module. This will define a class method for classes/modules and # an additional instance method for classes. def options(name, *args, &block) NsOptions::RootMethods.new(self, name).define($stdout, caller) self.send(name, *args, &block) end alias_method :opts, :options alias_method :namespace, :options alias_method :ns, :options end end
Version data entries
6 entries across 6 versions & 1 rubygems