Skip to content

Commit

Permalink
Show the container in the asset output
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamMcCumstie committed Aug 17, 2020
1 parent f415d92 commit ab35491
Showing 1 changed file with 51 additions and 1 deletion.
52 changes: 51 additions & 1 deletion lib/flight_asset/commands/concerns/has_assets_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,57 @@ def table_procs
].tap do |t|
append_decommissioned(t)

t << ['ID', ->(a) { a.id }] if verbose?
if verbose?
t << ['ID', ->(a) { a.id }]
t << ['Parent Container', ->(a) do
if a.parentContainer.nil?
tty_none_or_nil
else
a.parentContainer.name
end
end]
t << ['Container Type', ->(a) do
if a.parentContainer.nil?
tty_none_or_nil
else
a.parentContainer.containerType
end
end]
t << ['X Start Position', ->(a) do
a.xStartPosition || tty_none_or_nil
end]
t << ['X End Position', ->(a) do
a.xEndPosition || tty_none_or_nil
end]
t << ['Y Start Position', ->(a) do
a.yStartPosition || tty_none_or_nil
end]
t << ['Y End Position', ->(a) do
a.yEndPosition || tty_none_or_nil
end]
else
t << ['ParentContainer', ->(a) do
if a.parentContainer.nil?
tty_none_or_nil
else
"#{a.parentContainer.containerType} - #{a.parentContainer.name}"
end
end]
t << ['X Position', ->(a) do
if a.xStartPosition || a.xEndPosition
"#{a.xStartPosition} - #{a.xEndPosition}"
else
tty_none_or_nil
end
end]
t << ['Y Position', ->(a) do
if a.yStartPosition || a.yEndPosition
"#{a.yStartPosition} - #{a.yEndPosition}"
else
tty_none_or_nil
end
end]
end

t << ['Additional Information', ->(a) do
if tty? && a.info.to_s.length > 0
Expand Down

0 comments on commit ab35491

Please sign in to comment.