Sha256: 508951d418bfcbc8dcd27bb3471c8ab9408167b00fb373a54abb5a91e65f626a

Contents?: true

Size: 1.55 KB

Versions: 3

Compression:

Stored size: 1.55 KB

Contents


* is a subclass of extlib's `Mash` (Hash with indifferent access). 
  - in the 

* does not have to be performant. Obviously it can't suck, but we're not going to worry about say the overhead of converting values to `dsl_mash`es on assignment.

## Layering

This is the key thing. We don't prescribe *any* resolution semantics except the following:

* layers are evaluated in order to create a composite, `dup`ing as you go.
* while building a composite, when a later layer and the current layer collide:
  - if layer has merge logic, hand it off. 
  - simple + any:      clobber
  - array + array:     layer value appended to composite value
  - hash  + hash:      recurse
  - otherwise:         error
  
###  no complicated resolution rules allowed

This is the key to the whole thing.

* You can very easily 
* You can adorn an object with merge logic if it's more complicated than that

### duping (?)

I'm not certain of the always-`dup` rule. We'll find out

__________________________________________________________________________

## Interface

### setter/getter/block


* `self.foo`                -- returns value of foo
* `self.get(:foo)`          -- sets foo to val
* `self.foo(val)`           -- sets foo to val
* `self.set(:foo, val)`     -- sets foo to val
* `self.foo ||= val`        -- sets foo to val if foo is unset, `false` or `nil`
* `self.default(:foo, val)` -- sets foo to val if foo is unset
* `self.unset(:foo)`        -- unsets foo
   
### collection attributes


    | array    | array  |     add or clobber
    | 
   
### nested objects   


### type co

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ironfan-3.1.3 notes/design_notes-dsl_object.md
ironfan-3.1.2 notes/design_notes-dsl_object.md
ironfan-3.1.1 notes/design_notes-dsl_object.md