Class: Huebot::Program

Inherits:
Object
  • Object
show all
Defined in:
lib/huebot/program.rb

Defined Under Namespace

Classes: ParallelTransition, Transition

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeProgram

Returns a new instance of Program.



15
16
17
18
19
20
21
22
23
24
# File 'lib/huebot/program.rb', line 15

def initialize
  @name = nil
  @initial_state = nil
  @transitions = []
  @final_state = nil
  @loop = false
  @loops = 0
  @errors = []
  @warnings = []
end

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



12
13
14
# File 'lib/huebot/program.rb', line 12

def errors
  @errors
end

#final_stateObject

Returns the value of attribute final_state.



9
10
11
# File 'lib/huebot/program.rb', line 9

def final_state
  @final_state
end

#initial_stateObject

Returns the value of attribute initial_state.



7
8
9
# File 'lib/huebot/program.rb', line 7

def initial_state
  @initial_state
end

#loopObject Also known as: loop?

Returns the value of attribute loop.



10
11
12
# File 'lib/huebot/program.rb', line 10

def loop
  @loop
end

#loopsObject

Returns the value of attribute loops.



11
12
13
# File 'lib/huebot/program.rb', line 11

def loops
  @loops
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/huebot/program.rb', line 6

def name
  @name
end

#transitionsObject

Returns the value of attribute transitions.



8
9
10
# File 'lib/huebot/program.rb', line 8

def transitions
  @transitions
end

#warningsObject

Returns the value of attribute warnings.



13
14
15
# File 'lib/huebot/program.rb', line 13

def warnings
  @warnings
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/huebot/program.rb', line 26

def valid?
  errors.empty?
end