Define inspect on Option and Options
This commit is contained in:
parent
5f38c19ba8
commit
92857a7bd8
@ -31,6 +31,10 @@ class Option
|
|||||||
name.hash
|
name.hash
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def inspect
|
||||||
|
"#<#{self.class}: #{flag.inspect}>"
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def split_name(name)
|
def split_name(name)
|
||||||
@ -101,6 +105,10 @@ class Options
|
|||||||
end
|
end
|
||||||
alias_method :to_ary, :to_a
|
alias_method :to_ary, :to_a
|
||||||
|
|
||||||
|
def inspect
|
||||||
|
"#<#{self.class}: #{@options.map(&:inspect).join(", ")}>"
|
||||||
|
end
|
||||||
|
|
||||||
def self.coerce(arg)
|
def self.coerce(arg)
|
||||||
case arg
|
case arg
|
||||||
when self then arg
|
when self then arg
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user