Skip to content

Support block defaults for module attributes#317

Open
landeqiming666 wants to merge 1 commit into
rubyworks:mainfrom
landeqiming666:add-block-default-examples
Open

Support block defaults for module attributes#317
landeqiming666 wants to merge 1 commit into
rubyworks:mainfrom
landeqiming666:add-block-default-examples

Conversation

@landeqiming666

Copy link
Copy Markdown

Summary

  • support block defaults for cattr and mattr reader/writer/accessor helpers
  • preserve existing class variable values instead of replacing them with block defaults
  • add focused tests and QED-style examples for block defaults

Fixes #258.

Validation

  • ruby -c lib/core/facets/module/mattr.rb
  • ruby -c test/core/module/test_mattr.rb
  • ruby -Ilib/core target smoke test for reader, accessor, memoization, and writer behavior
  • git diff --check HEAD~1..HEAD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mattr/cattr (aka attribute accessors) to keep up with the times

1 participant