Comments (6)
Hmm. I think I'd be ok with something like this, but the second argument is already used for limiting the fields including (and is an array). So we probably shouldn't just replace it with a hash. Maybe we could do it where each thing in that array can be a string to just include the key or a one keypair hash to remap it. So your example would be like:
Formatador.display_table(table_data, [{"name": "Name"}, {"meal.drink": "Drink"}])
What do you think? Thanks!
from formatador.
I wasn't suggesting replacing that argument. I was just suggesting allowing either a hash or array to be passed. Although your suggestion of an array of hashes works as well :)
from formatador.
AH. Yeah, that makes sense. I think maybe I would prefer array or hash (vs array of hashes) in that case. Array of hashes is weird...
from formatador.
However, is the order if iteration over key-value pairs in hashes defined in Ruby? If not and you use a hash (instead of an array of hashes) then you lose the ability to reliably define the order of output fields.
from formatador.
Ah, yeah, good call. hash keys are not ordered, so perhaps array-of-hashes is worthwhile after all. It has the added side-benefit that you can more simply include the non-translated keys too.
from formatador.
This issue has been marked inactive and will be closed if no further activity occurs.
from formatador.
Related Issues (15)
- Empty lines in a simple table HOT 1
- Decouple From Terminal + Add HTML / Spreadsheets Output? HOT 4
- Rewrite headers to desired output HOT 5
- Add License information to gemfile HOT 1
- Semantic Versioning HOT 4
- Allow display of a row index HOT 4
- Better visualization on README HOT 5
- Allow to send color codes even if no tty HOT 3
- make a new release? HOT 1
- Is there a way to right-justify a numeric HOT 3
- Building on travis-ci.org is ceased HOT 1
- 1.1 missing in changelog HOT 1
- uninitialized constant StringIO while running tests HOT 4
- Tests fail when redirected to a file HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from formatador.