Class: Choose
Instance Attribute Summary collapse
-
#choice ⇒ Object
Returns the value of attribute choice.
-
#op1 ⇒ Object
Returns the value of attribute op1.
-
#op2 ⇒ Object
Returns the value of attribute op2.
Attributes inherited from Base
Instance Method Summary collapse
- #arduino_code ⇒ Object
- #cycle_level_arduino_code ⇒ Object
- #param_keys ⇒ Object
- #top_level_scope_code ⇒ Object
Methods inherited from Base
#add_arduino_code, #add_cycle_level_scope, #add_top_level_scope, #append_tsortable, #buildit, #depends_on, #initialize, #resolve_frame_optimized, #top_level_scope_arduino_code
Constructor Details
This class inherits a constructor from Base
Instance Attribute Details
#choice ⇒ Object
Returns the value of attribute choice.
12 13 14 |
# File 'lib/functions/choose.rb', line 12 def choice @choice end |
#op1 ⇒ Object
Returns the value of attribute op1.
13 14 15 |
# File 'lib/functions/choose.rb', line 13 def op1 @op1 end |
#op2 ⇒ Object
Returns the value of attribute op2.
14 15 16 |
# File 'lib/functions/choose.rb', line 14 def op2 @op2 end |
Instance Method Details
#arduino_code ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/functions/choose.rb', line 20 def arduino_code unless @frame_optimized [ "choose(#{@choice.name}, #{@op1.name}, #{@op2.name}, #{@name}, choose_half_phase);" ] else [] end end |
#cycle_level_arduino_code ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/functions/choose.rb', line 30 def cycle_level_arduino_code if @frame_optimized [ "choose(#{@choice.name}, #{@op1.name}, #{@op2.name}, #{@name}, choose_half_phase);" ] else [] end end |
#param_keys ⇒ Object
16 17 18 |
# File 'lib/functions/choose.rb', line 16 def param_keys [:choice, :op1, :op2] end |
#top_level_scope_code ⇒ Object
40 41 42 43 44 45 |
# File 'lib/functions/choose.rb', line 40 def top_level_scope_code [ "long choose_half_phase = INTEGER_SCALE / 2 - 1;", "long #{@name}[3];" ] end |