Class: GovukContentModels::ActionProcessors::BaseProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/govuk_content_models/action_processors/base_processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(actor, edition, action_attributes = {}, event_attributes = {}) ⇒ BaseProcessor

Returns a new instance of BaseProcessor.



6
7
8
9
10
11
# File 'lib/govuk_content_models/action_processors/base_processor.rb', line 6

def initialize(actor, edition, action_attributes={}, event_attributes={})
  @actor = actor
  @edition = edition
  @action_attributes = action_attributes
  @event_attributes = event_attributes
end

Instance Attribute Details

#action_attributesObject

Returns the value of attribute action_attributes.



4
5
6
# File 'lib/govuk_content_models/action_processors/base_processor.rb', line 4

def action_attributes
  @action_attributes
end

#actorObject

Returns the value of attribute actor.



4
5
6
# File 'lib/govuk_content_models/action_processors/base_processor.rb', line 4

def actor
  @actor
end

#editionObject

Returns the value of attribute edition.



4
5
6
# File 'lib/govuk_content_models/action_processors/base_processor.rb', line 4

def edition
  @edition
end

#event_attributesObject

Returns the value of attribute event_attributes.



4
5
6
# File 'lib/govuk_content_models/action_processors/base_processor.rb', line 4

def event_attributes
  @event_attributes
end

Instance Method Details

#processed_editionObject



13
14
15
16
17
18
# File 'lib/govuk_content_models/action_processors/base_processor.rb', line 13

def processed_edition
  if process? && process
    record_action if record_action?
    edition
  end
end