Class: Hexagonal::Mediators::CreateMediator
- Inherits:
-
Object
- Object
- Hexagonal::Mediators::CreateMediator
- Defined in:
- lib/hexagonal/mediators/create_mediator.rb
Instance Attribute Summary collapse
-
#repository ⇒ Object
writeonly
Sets the attribute repository.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(user, attributes) ⇒ CreateMediator
constructor
A new instance of CreateMediator.
Constructor Details
#initialize(user, attributes) ⇒ CreateMediator
Returns a new instance of CreateMediator.
8 9 10 11 |
# File 'lib/hexagonal/mediators/create_mediator.rb', line 8 def initialize(user, attributes) @user = user @attributes = attributes.merge(default_attributes) end |
Instance Attribute Details
#repository=(value) ⇒ Object
Sets the attribute repository
6 7 8 |
# File 'lib/hexagonal/mediators/create_mediator.rb', line 6 def repository=(value) @repository = value end |
Instance Method Details
#call ⇒ Object
13 14 15 |
# File 'lib/hexagonal/mediators/create_mediator.rb', line 13 def call repository.save! target end |