Define inspect on Option and Options

This commit is contained in:
Jack Nagel 2013-05-24 10:56:02 -05:00
parent 5f38c19ba8
commit 92857a7bd8

View File

@ -31,6 +31,10 @@ class Option
name.hash
end
def inspect
"#<#{self.class}: #{flag.inspect}>"
end
private
def split_name(name)
@ -101,6 +105,10 @@ class Options
end
alias_method :to_ary, :to_a
def inspect
"#<#{self.class}: #{@options.map(&:inspect).join(", ")}>"
end
def self.coerce(arg)
case arg
when self then arg