Recently, I came across some of my old code that uses Rails’ delegate method. Take a look at the following example, where I’m delegating a couple of methods to an instance variable, but want to make them private. class UserDecorator def initialize(user) @user = user end def full_name "#{first_name} #{last_name}" end private delegate :first_name, :last_name, to: :@user end My intention was to make
私が $ mix new foo でライブラリを新規作成したあとに毎回必ずやっていること。 2018年12月現在は以下の4つだ。 ドキュメント生成ツール ex_doc 追加 静的解析ツール dialyxir 追加(型チェック) 静的解析ツール credo 追加(Lint) フォーマッタで折り返される1行あたりの文字数を120にする ドキュメント生成ツール ex_doc ex_doc は Elixir を用いたプロジェクトのドキュメントを生成してくれるライブラリ。それだけでなく Elixir 自身のドキュメントも ex_doc を用いて出力されている。 mix.exs に追加する diff --git a/mix.exs b/mix.exs index f6d766a..d18402d 100644 --- a/mix.exs +++ b/mix.exs @@ -21,8 +21,7 @@
Property-Based Testing with PropEr, Erlang, and Elixir Today, I'm publishing a new book: Property-Based Testing with PropEr, Erlang, and Elixir. It's my third book, the second one that is not self-published. Back in 2016, I wrote a blog post titled Property-Based Testing Basics, where I intended to start a short series of introductory blog posts explaining property-based testing. However, as soon
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く