Class: Post

Inherits:
Sequent::AggregateRoot
  • Object
show all
Defined in:
lib/sequent/generator/template_project/lib/post/post.rb

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ Post

Returns a new instance of Post.



2
3
4
5
6
7
8
# File 'lib/sequent/generator/template_project/lib/post/post.rb', line 2

def initialize(command)
  super(command.aggregate_id)
  apply PostAdded
  apply PostAuthorChanged, author: command.author
  apply PostTitleChanged, title: command.title
  apply PostContentChanged, content: command.content
end