Module: OptparseLite::OptParser::Error
- Included in:
- UnparsedParamters
- Defined in:
- lib/optparse-lite.rb
Instance Attribute Summary collapse
-
#error_type ⇒ Object
Returns the value of attribute error_type.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#error_type ⇒ Object
Returns the value of attribute error_type.
814 815 816 |
# File 'lib/optparse-lite.rb', line 814 def error_type @error_type end |
Class Method Details
.[](mixed) ⇒ Object
816 817 818 |
# File 'lib/optparse-lite.rb', line 816 def [](mixed) mixed.extend(self) end |
.new(error_type, message, opts = {}) ⇒ Object
819 820 821 822 823 |
# File 'lib/optparse-lite.rb', line 819 def new error_type, , opts={} ret = self[.dup] ret.error_init error_type, opts ret end |
Instance Method Details
#error_init(error_type, opts) ⇒ Object
825 826 827 828 829 830 831 832 833 |
# File 'lib/optparse-lite.rb', line 825 def error_init error_type, opts @error_type = error_type opts.each do |(k,v)| /^(.+[^?])(\?)?$/ =~ k.to_s attr_name = $1 instance_variable_set("@#{attr_name}", v) def!(k){ instance_variable_get("@#{attr_name}") } end end |