Red > Green > Refactor > Red

cycle is based on desire

Struct ruby

(゚∀゚)

$ irb
> class Article < Struct.new(:title, :body)
> end
  #=> nil

> article = Article.new
  #=> #<struct Article title=nil, body=nil>

> article.title = 'example'
  #=> "example"

> article.body = 'example body'
  #=> "example body"

> p article
  #<struct Article title="example", body="example body">

参考

moonstruckdrops.github.io