Comments (13)
🤘
from virtus.
@dkubb would you agree that both should go to the same gem? Does Veritas need type lookup?
from virtus.
@solnic I probably need to think about it for a bit. I believe Veritas has a simple descendants + type lookup system, and it was for mostly the same reasons.. I map primitive objects onto Veritas::Attribute subclasses and choose the best match for a given primitive.
from virtus.
@dkubb yeah that's what I thought so. It's definitely a common pattern for both libs.
from virtus.
@dkubb right, so it seems like Veritas::Attribute
has a very similar implementation of #descendants
as we have in Virtus. I'm thinking about extracting this stuff (along with TypeLookup) to a gem called maybe just "descendants". WDYT?
from virtus.
Might it be something that Ruby could/should support out of the box? If so suggest it for future version.
from virtus.
The way we wrote descendants was to complement ancestors which is supplied by ruby stdlib. I would love for Ruby to support it natively, maybe we should suggest it. OTOH I am a bit concerned with other things getting added for 2.0 so I am a bit reluctant.
from virtus.
I would love to get this done for 0.5.0. @dkubb are you willing to do it? it would be nice since it's basically your code if I remember correctly :)
from virtus.
@solnic I'm focused on making veritas relations writable. I don't think this is a super high priority task; not enough to put veritas work on hold atm.
In general almost everything in the "support" lib of both veritas and virtus could probably be split out into stand-alone libraries (that's kind of the criteria for something to live in that directory). We could hold those extraction projects back as good lead-in projects for people wanting to contribute to DM2 development. They're tiny, already include lots of docs and tests, and provide people a good way to get involved without too much overhead. Plus they allow people to learn the way we're structuring the project (like "rake ci") without compromising the structure of the core system. In short, I think they're perfect way to introduce people to DM2 development.
from virtus.
I should mention that assuming no one picks up these projects, I plan to circle back to them when I run out of steam on some of the more complex parts of DM2. I usually have a couple of low complexity tasks set side for when I'm tired or burnt out (or coming back from a burn-out), and if no one picks these up I'll probably keep them as "active rest" type projects.
from virtus.
@dkubb I am willing to help wherever I can to move the DM2 project forward. If this is something you like the see done, please let me know what you expect and what guidelines to follow. I would be pleased to help.
from virtus.
Closing as descendants tracker is already extracted.
from virtus.
Extracted to: dkubb/descendants_tracker
from virtus.
Related Issues (20)
- Publish 1.0.6
- Avoid override of previously assigned attributes
- Put link to dry-rb in README.md to save time for new comers
- possible to dynamically add attributes? HOT 1
- What replaces `ValueObject::InstanceMethods::with`?
- Class not getting initialized HOT 1
- Bug: nil default value of Array attribute ignored HOT 1
- Coerce proc and strict mode don't match
- Default values aren't assigned when initialize method is present. HOT 1
- Array of Array of FooClass
- Strange Boolean behaviour HOT 5
- Validation from class attributes
- Show Embedded value on edit form
- Calling methods inside of a Virtus::Attribute
- Mark as unmaintaned HOT 2
- Hash.try_convert(attributes) errors on params in Rails 5
- FixedWidth Coercion HOT 2
- Date formats HOT 1
- How can I use array of tags(Strings) in a key of a hash? HOT 1
- Strict mode only works for basic values HOT 4
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 virtus.