Class: Stupidedi::Builder::StateMachine
Instance Attribute Summary collapse
Instance Method Summary
collapse
#blank, #composite, #default, #not_used, #repeated
Methods included from Generation
#execute, #insert, #read, #update_reader
Methods included from Navigation
#count, #count!, #deterministic?, #distance, #element, #elementn, #empty?, #find, #find!, #first, #first?, #iterate, #last, #last?, #next, #parent, #prev, #segment, #segmentn, #sequence, #successors, #zipper
Methods included from Inspect
#inspect
Constructor Details
#initialize(config, active) ⇒ StateMachine
Returns a new instance of StateMachine.
20
21
22
|
# File 'lib/stupidedi/builder/state_machine.rb', line 20
def initialize(config, active)
@config, @active = config, active
end
|
Instance Attribute Details
18
19
20
|
# File 'lib/stupidedi/builder/state_machine.rb', line 18
def active
@active
end
|
15
16
17
|
# File 'lib/stupidedi/builder/state_machine.rb', line 15
def config
@config
end
|
Instance Method Details
#copy(changes = {}) ⇒ Object
24
25
26
27
28
|
# File 'lib/stupidedi/builder/state_machine.rb', line 24
def copy(changes = {})
StateMachine.new \
changes.fetch(:config, @config),
changes.fetch(:active, @active)
end
|
#pretty_print(q) ⇒ void
This method returns an undefined value.
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/stupidedi/builder/state_machine.rb', line 36
def pretty_print(q)
q.text "StateMachine[#{@active.length}]"
q.group 2, "(", ")" do
q.breakable ""
@active.each do |s|
unless q.current_group.first?
q.text ","
q.breakable
end
q.pp s.node.zipper.node
end
end
end
|
31
32
33
|
# File 'lib/stupidedi/builder/state_machine.rb', line 31
def separators
@active.head.node.separators
end
|