Class: Hexagonal::Mediators::CreateMediator

Inherits:
Object
  • Object
show all
Defined in:
lib/hexagonal/mediators/create_mediator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Parameters:

  • value

    the value to set the attribute repository to.



6
7
8
# File 'lib/hexagonal/mediators/create_mediator.rb', line 6

def repository=(value)
  @repository = value
end

Instance Method Details

#callObject



13
14
15
# File 'lib/hexagonal/mediators/create_mediator.rb', line 13

def call
  repository.save! target
end