Class: KDirector::Builders::ActionsBuilder

Inherits:
DomBuilder
  • Object
show all
Defined in:
lib/k_director/builders/actions_builder.rb

Overview

Actions document builder

Instance Attribute Summary collapse

Attributes inherited from DomBuilder

#dom

Instance Method Summary collapse

Methods inherited from DomBuilder

#add, #build, #group_set, #initialize, #set, #to_json

Constructor Details

This class inherits a constructor from KDirector::Builders::DomBuilder

Instance Attribute Details

#actionsObject (readonly)

Returns the value of attribute actions.



7
8
9
# File 'lib/k_director/builders/actions_builder.rb', line 7

def actions
  @actions
end

#last_actionObject (readonly)

Returns the value of attribute last_action.



8
9
10
# File 'lib/k_director/builders/actions_builder.rb', line 8

def last_action
  @last_action
end

Instance Method Details

#debugObject



21
22
23
24
25
26
# File 'lib/k_director/builders/actions_builder.rb', line 21

def debug
  puts JSON.pretty_generate(actions)
  super

  self
end

#queue_action(action) ⇒ Object



16
17
18
19
# File 'lib/k_director/builders/actions_builder.rb', line 16

def queue_action(action)
  @actions << action
  @last_action = action
end

#resetObject



10
11
12
13
14
# File 'lib/k_director/builders/actions_builder.rb', line 10

def reset
  super
  @actions = []
  @last_action = {}
end