Class: Ref
Instance Attribute Summary collapse
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#ref_name ⇒ Object
Returns the value of attribute ref_name.
Attributes inherited from Base
Instance Method Summary collapse
- #arduino_code ⇒ Object
-
#initialize(params) ⇒ Ref
constructor
A new instance of Ref.
- #top_level_scope_code ⇒ Object
Methods inherited from Base
#add_arduino_code, #add_cycle_level_scope, #add_top_level_scope, #append_tsortable, #buildit, #cycle_level_arduino_code, #depends_on, #param_keys, #resolve_frame_optimized, #top_level_scope_arduino_code
Constructor Details
#initialize(params) ⇒ Ref
Returns a new instance of Ref.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/functions/ref.rb', line 6 def initialize(params) super(params) @identifier = params[:identifier] if $refs.has_key?(@identifier) @ref_name = $refs[@identifier] @frame_optimized = $refs_frame_optimized[@identifier] else raise "non-existant ref #{@identifier}" end end |
Instance Attribute Details
#identifier ⇒ Object
Returns the value of attribute identifier.
3 4 5 |
# File 'lib/functions/ref.rb', line 3 def identifier @identifier end |
#ref_name ⇒ Object
Returns the value of attribute ref_name.
4 5 6 |
# File 'lib/functions/ref.rb', line 4 def ref_name @ref_name end |
Instance Method Details
#arduino_code ⇒ Object
17 18 19 20 |
# File 'lib/functions/ref.rb', line 17 def arduino_code [ ] end |
#top_level_scope_code ⇒ Object
22 23 24 25 26 |
# File 'lib/functions/ref.rb', line 22 def top_level_scope_code [ "long *#{@name} = #{@ref_name};" ] end |