Module: OptionsHash::MethodObject::ClassMethods
- Defined in:
- lib/options_hash/method_object.rb
Instance Method Summary collapse
- #call(options = {}) ⇒ Object
- #optional(*keys, &block) ⇒ Object
- #options ⇒ Object
- #required(*keys, &block) ⇒ Object
- #to_proc ⇒ Object
Instance Method Details
#call(options = {}) ⇒ Object
14 15 16 |
# File 'lib/options_hash/method_object.rb', line 14 def call ={} new().call end |
#optional(*keys, &block) ⇒ Object
31 32 33 |
# File 'lib/options_hash/method_object.rb', line 31 def optional *keys, &block .optional *keys, &block end |
#options ⇒ Object
22 23 24 25 |
# File 'lib/options_hash/method_object.rb', line 22 def @options ||= Class.new(superclass.respond_to?(:options) ? superclass. : OptionsHash) end |
#required(*keys, &block) ⇒ Object
27 28 29 |
# File 'lib/options_hash/method_object.rb', line 27 def required *keys, &block .required *keys, &block end |
#to_proc ⇒ Object
18 19 20 |
# File 'lib/options_hash/method_object.rb', line 18 def to_proc method(:call).to_proc end |