Giter Site home page Giter Site logo

Comments (9)

saturnflyer avatar saturnflyer commented on May 30, 2024

Definitely a consideration. I've run into this need.

from casting.

krisleech avatar krisleech commented on May 30, 2024

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.

saturnflyer avatar saturnflyer commented on May 30, 2024

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.

krisleech avatar krisleech commented on May 30, 2024

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.

gregory avatar gregory commented on May 30, 2024

ping :)

from casting.

krisleech avatar krisleech commented on May 30, 2024

@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.

saturnflyer avatar saturnflyer commented on May 30, 2024

I'd love to have more feedback on this @gregory

from casting.

gregory avatar gregory commented on May 30, 2024

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.

saturnflyer avatar saturnflyer commented on May 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.