Class: Divide
Instance Attribute Summary collapse
-
#denominator ⇒ Object
Returns the value of attribute denominator.
-
#numerator ⇒ Object
Returns the value of attribute numerator.
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
#denominator ⇒ Object
Returns the value of attribute denominator.
13 14 15 |
# File 'lib/functions/divide.rb', line 13 def denominator @denominator end |
#numerator ⇒ Object
Returns the value of attribute numerator.
12 13 14 |
# File 'lib/functions/divide.rb', line 12 def numerator @numerator end |
Instance Method Details
#arduino_code ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/functions/divide.rb', line 19 def arduino_code unless @frame_optimized [ "divide(#{@numerator.name}, #{@denominator.name}, #{@name});" ] else [] end end |
#cycle_level_arduino_code ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/functions/divide.rb', line 29 def cycle_level_arduino_code if @frame_optimized [ "divide(#{@numerator.name}, #{@denominator.name}, #{@name});" ] else [] end end |
#param_keys ⇒ Object
15 16 17 |
# File 'lib/functions/divide.rb', line 15 def param_keys [:numerator, :denominator] end |
#top_level_scope_code ⇒ Object
39 40 41 42 43 |
# File 'lib/functions/divide.rb', line 39 def top_level_scope_code [ "long #{@name}[3];" ] end |