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
{{ message }}
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.
As an example for what I want I'll use the YAML adapter for working with configuration files.
Let's say I have a configuration file that's devided into different sections:
---
- name: sectionkey: valuefoo: bar
- name: other_sectionherp: derp
The key-value pairs in each section are supposed to be more or less fluid. Though currently I'd need to specify each key in the model in order for DataMapper to read/write it.
I have some code in dm-types (greedy branch) and dm-yaml-adapter (greedy branch) that implements a kind of meta-property that reads and writes all properties that are not part of the defined model and makes them accessible as a Hash.
With these changes I'm able to define the following model:
As an example for what I want I'll use the YAML adapter for working with configuration files.
Let's say I have a configuration file that's devided into different sections:
The key-value pairs in each section are supposed to be more or less fluid. Though currently I'd need to specify each key in the model in order for DataMapper to read/write it.
I have some code in dm-types (greedy branch) and dm-yaml-adapter (greedy branch) that implements a kind of meta-property that reads and writes all properties that are not part of the defined model and makes them accessible as a Hash.
With these changes I'm able to define the following model:
The greedy property needs support from each used adapter, as the adapter needs to read and write the out-of-model properties to the greedy property.
What do you think about this? Are there other approaches to this or even an existing solution?
The text was updated successfully, but these errors were encountered: