Last active
December 17, 2015 15:08
-
-
Save mbj/5629003 to your computer and use it in GitHub Desktop.
stats transformer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Vehicles | |
class Transformer | |
# Namespace for stats ducktraps | |
Stats = Ducktrap::Mapper.build do | |
dumper do | |
part_dumper = | |
Ducktrap.build do | |
anima_dump(Vehicles::Import::Mobile::Part::Stats) | |
hash_transform do | |
fetch_key(:total) { dump_key('total') } | |
fetch_key(:invalid) { dump_key('invalid') } | |
fetch_key(:valid) { dump_key('valid') } | |
end | |
end | |
Ducktrap.build do | |
anima_dump(Vehicles::Import::Mobile::Stats) | |
hash_transform do | |
fetch_key(:vehicle) do | |
add(PART_DUMPER) | |
dump_key('vehicle') | |
end | |
fetch_key(:row) do | |
add(PART_DUMPER) | |
dump_key('row') | |
end | |
fetch_key(:entry) do | |
add(PART_DUMPER) | |
dump_key('entry') | |
end | |
fetch_key(:image) do | |
add(PART_DUMPER) | |
dump_key('image') | |
end | |
end | |
end | |
end # dumper | |
end # mapper | |
end # Transformer | |
end # Vehicles |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment