You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When looking at Squib example code, I'm often confused by what is a built-in layout and what isn't. I know there are only a few built-ins currently, but I'm not too good at remembering things I only use occasionally, so it get's confusing.
Describe the solution you'd like
I think it would be nice if the built-in layouts were specified as symbols instead of file names. Besides lessening confusion, this seems more Ruby-ish to me. So instead of something like Squib::Deck.new cards: 1, layout: 'hand.yml' do you'd have Squib::Deck.new cards: 1, layout: :hand do.
I imagine (but haven't checked yet) that the current code has multiple paths that it looks for specified layout files in (one of which is the /lib/squib/builtin/layouts/ directory of the Squib installation), and that's why you have to specify a full file name for built-ins. I think you could keep that (so you don't break older code) and add an additional check to see if the argument passed is a symbol, and if so, internally convert it to a file name and look for it only in the built-in's directory.
Describe alternatives you've considered
I'm not sure what a good alternative would be.
I might be interested in implementing this myself
Not sure I have time right now to try working on this, sorry.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
When looking at Squib example code, I'm often confused by what is a built-in layout and what isn't. I know there are only a few built-ins currently, but I'm not too good at remembering things I only use occasionally, so it get's confusing.
Describe the solution you'd like
I think it would be nice if the built-in layouts were specified as symbols instead of file names. Besides lessening confusion, this seems more Ruby-ish to me. So instead of something like
Squib::Deck.new cards: 1, layout: 'hand.yml' do
you'd haveSquib::Deck.new cards: 1, layout: :hand do
.I imagine (but haven't checked yet) that the current code has multiple paths that it looks for specified layout files in (one of which is the
/lib/squib/builtin/layouts/
directory of the Squib installation), and that's why you have to specify a full file name for built-ins. I think you could keep that (so you don't break older code) and add an additional check to see if the argument passed is a symbol, and if so, internally convert it to a file name and look for it only in the built-in's directory.Describe alternatives you've considered
I'm not sure what a good alternative would be.
Not sure I have time right now to try working on this, sorry.
The text was updated successfully, but these errors were encountered: