Comments (9)
Definitely a consideration. I've run into this need.
from casting.
This commit is a quick spike for the idea, very simple use case. The test is ad-hoc. Unless you have any comments I'll close for now and submit a proper PR if you think it might be useful.
from casting.
Finally getting back to this. Looks good. Thanks!
I'm wondering about this being lazy or being able to cast/uncast with a block.
cast_map(SomeModule) do |item|
# whatever here
end
That could tie in to Casting.delegating
. Or is that sufficient?
Perhaps we could roll in cast_members_as
for now and consider those alternatives later.
from casting.
A proper PR for cast_members_as
would be a good starting point.
I don't specifically have the need for lazy casting but I like the idea and would be happy to look in to it. I feel this would ultimately fit casting well. Would expect the collection members to be uncast after the cast_map
block had yielded?
from casting.
ping :)
from casting.
@gregory I didn't currently do any further work on this. Would you like to take this forward or shall I close this issue for now?
from casting.
I'd love to have more feedback on this @gregory
from casting.
No need for now, i was just wondering since this is the first thing that came to my mind when i saw casting :)
Using DelegateClass for now. might consider to use casting pretty soon. i'll then get back to you guys.
@krisleech feel free to close, we could still reopen in the futur.
from casting.
It's been a long time but I think this might be solved by https://github.com/saturnflyer/casting/blob/297699ee9f58fa4a4c00fc89e442b700d9459e55/lib/casting/enum.rb
Closing but please reopen if that doesn't do it.
from casting.
Related Issues (12)
- Consider alternate method names
- Mixin naming: Casting::Client vs. Castable HOT 3
- Possibly incompatible with New Relic agent (or the other way around.) HOT 5
- Report methods from delegates when querying a client HOT 1
- NoMethodError undefined method `cast_as` HOT 2
- how to cast_as rspec doubles? HOT 6
- methods added by module not accessible from within module HOT 9
- Examples HOT 1
- get super_delegate to work with more than one pass HOT 1
- Allow arguments to be passed into the `call` method
- Make Class-level casting (refinements) threadsafe HOT 6
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 casting.