Sha256: c4ca6de80901ea1ea815bb78d05c0b6bd6f8b262939de81aa098c6d5e1f46eb4

Contents?: true

Size: 570 Bytes

Versions: 1

Compression:

Stored size: 570 Bytes

Contents

# LazyMapper

Wraps a Hash and lazily maps its attributes to rich domain objects using either a set of default mappers (for Ruby's built-in types), or custom mappers specified by the client.

The mapped values are memoized.

Example:

    class Foo < LazyMapper
      one :id, Integer, from: 'iden'
      one :created_at, Time
      one :amount, Money, map: Money.method(:parse)
      many :users, User, map: ->(u) { User.new(u) }
    end

## Documentation

See [RubyDoc](https://www.rubydoc.info/gems/lazy_mapper/LazyMapper)

## License

See [LICENSE](./LICENSE) file.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lazy_mapper-0.2.1 README.md