<commit_before>### master
[full changelog](http://github.com/plexus/yaks/compare/v0.7.5...master)

### 0.7.6

Much expanded form support, simplified link DSL, pretty-print objects
to Ruby code.

Breaking change: using a symbol instead of link template no longer
works, use a lambda.

    link :foo, :bar

Becomes

    link :foo, ->{ bar }

Strictly speaking the equivalent version would be `link :foo, ->{
load_attribute(:bar) }`. Depending on if `bar` is implemented on the
mapper or is an attribute of the object, this would simplify to `link
:foo, ->{ bar }` or `link :foo, ->{ object.bar }` respectively.

The form control DSL has been expanded, instead of `field type:
'text'` and similar there are now aliases, e.g. `text :name, value:
'foo'`.

All attributes on the form control itself, and on fields, now
optionally take a lambda (any `#to_proc`-able) for dynamic
content. e.g.

    control :add_product do
      method 'POST'
      action ->{ '/cart/#{cart.id}/line_items' }
      hidden :product_id, value: -> { product.id }
      number :quantity, value: 0
    end

As with lambdas used for links, in case of a zero-arity lambda these
evaluate with `self` being the mapper. If the lambda takes an argument
the argument will be the mapper, and the lambda is evaluated as a
closure.

The `href` attribute of a control has been renamed `action`, in line
with the attribute name in HTML. An alias is available but will output
a deprecation warning.

### 0.7.5

Add the :replace option to link specifications. When used on a link
when another link of the same rel was specified previously, then the
current link will replace the one (and any other) that was specified
earlier.

Use case:

    class BaseMapper < Yaks::Mapper<commit_msg>Mention Attributes#pp in the Changelog<commit_after>### master
[full changelog](http://github.com/plexus/yaks/compare/v0.7.5...v0.7.6)

### 0.7.6

Much expanded form support, simplified link DSL, pretty-print objects
to Ruby code.

Breaking change: using a symbol instead of link template no longer
works, use a lambda.

    link :foo, :bar

Becomes

    link :foo, ->{ bar }

Strictly speaking the equivalent version would be `link :foo, ->{
load_attribute(:bar) }`. Depending on if `bar` is implemented on the
mapper or is an attribute of the object, this would simplify to `link
:foo, ->{ bar }` or `link :foo, ->{ object.bar }` respectively.

The form control DSL has been expanded, instead of `field type:
'text'` and similar there are now aliases, e.g. `text :name, value:
'foo'`.

All attributes on the form control itself, and on fields, now
optionally take a lambda (any `#to_proc`-able) for dynamic
content. e.g.

    control :add_product do
      method 'POST'
      action ->{ '/cart/#{cart.id}/line_items' }
      hidden :product_id, value: -> { product.id }
      number :quantity, value: 0
    end

As with lambdas used for links, in case of a zero-arity lambda these
evaluate with `self` being the mapper. If the lambda takes an argument
the argument will be the mapper, and the lambda is evaluated as a
closure.

The `href` attribute of a control has been renamed `action`, in line
with the attribute name in HTML. An alias is available but will output
a deprecation warning.

The Yaks::Resource#pp method has been lifted into Attributes so it's
available on most immutable Yaks objects. It has also been adapted to
produce, in most cases, output that is valid Ruby code.

### 0.7.5

Add the :replace option to link specifications. When used on a link
when another link of the same rel was specified previously, then the
current link will replace the one (and any other) that was specified
earlier.

Use case:

    class BaseMapper < Yaks::Mapper
{'fraction_non_alphanumeric': 0.08987854251012145, 'fraction_numerical': 0.006207827260458839, 'mean_word_length': 3.7512820512820513, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2698685', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1069, 'n_words': 529}