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.



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

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