Sha256: db7fbeb6da5e26924957d73459ea25dd94d0910595b32d61f20a77ec251a49c4

Contents?: true

Size: 565 Bytes

Versions: 1

Compression:

Stored size: 565 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/0.3.0)

## License

See [LICENSE](./LICENSE) file.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lazy_mapper-0.3.0 README.md