Class: ActionTracker::Templates::BaseTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/action_tracker/templates/base_template.rb

Direct Known Subclasses

Create, Destroy, Update

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target, options = {}) ⇒ BaseTemplate

Returns a new instance of BaseTemplate.



8
9
10
11
# File 'lib/action_tracker/templates/base_template.rb', line 8

def initialize(target, options = {})
  @target = target
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/action_tracker/templates/base_template.rb', line 6

def options
  @options
end

#targetObject (readonly)

Returns the value of attribute target.



6
7
8
# File 'lib/action_tracker/templates/base_template.rb', line 6

def target
  @target
end

Instance Method Details

#formObject



13
14
15
16
17
18
19
# File 'lib/action_tracker/templates/base_template.rb', line 13

def form
  @form ||= ActionTracker::Models::TransitionRecord.new(
    payload: payload,
    reference: reference,
    created_at: created_at
  ).with_target(target)
end