-
Notifications
You must be signed in to change notification settings - Fork 52
Closed
Description
Commit: dc86aa6
Input
# initial input
module Amp
def self.trim_team(team)
{
descendent_members: (team[:descendant_members].map { |v| self.trim_person } if team[descendant_members]
.present?)
}
end
end
# output of formatting the above
module Amp
def self.trim_team(team)
{
descendent_members: (if team[descendant_members].present?
team[:descendant_members].map { |v| self.trim_person }
end)
}
end
end
# output of formatting the above, which is
# - not idempotent
# - what formatting the first bit should have produced in the first place
module Amp
def self.trim_team(team)
{
descendent_members: (
if team[descendant_members].present?
team[:descendant_members].map { |v| self.trim_person }
end
)
}
end
endOutput
# initial input
module Amp
def self.trim_team(team)
{
descendent_members: (if team[descendant_members].present?
team[:descendant_members].map { |v| self.trim_person }
end)
}
end
end
# output of formatting the above
module Amp
def self.trim_team(team)
{
descendent_members: (
if team[descendant_members].present?
team[:descendant_members].map { |v| self.trim_person }
end
)
}
end
end
# output of formatting the above, which is
# - not idempotent
# - what formatting the first bit should have produced in the first place
module Amp
def self.trim_team(team)
{
descendent_members: (
if team[descendant_members].present?
team[:descendant_members].map { |v| self.trim_person }
end
)
}
end
endExpected behavior
See embedded comments above.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels