Tab#to_s returns a one-line summary of the receipt
This commit is contained in:
parent
d9f64a1574
commit
5e5e82f9ef
@ -104,4 +104,18 @@ class Tab < OpenStruct
|
||||
def write
|
||||
tabfile.write to_json
|
||||
end
|
||||
|
||||
def to_s
|
||||
s = []
|
||||
case poured_from_bottle
|
||||
when true then s << "Poured from bottle"
|
||||
when false then s << "Built from source"
|
||||
end
|
||||
unless used_options.empty?
|
||||
s << "Installed" if s.empty?
|
||||
s << "with:"
|
||||
s << used_options.to_a.join(", ")
|
||||
end
|
||||
s.join(" ")
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user