Class: CreateRef
Instance Attribute Summary collapse
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Base
Instance Method Summary collapse
- #arduino_code ⇒ Object
-
#initialize(params) ⇒ CreateRef
constructor
A new instance of CreateRef.
- #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, #cycle_level_arduino_code, #depends_on, #resolve_frame_optimized, #top_level_scope_arduino_code
Constructor Details
#initialize(params) ⇒ CreateRef
Returns a new instance of CreateRef.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/functions/create_ref.rb', line 9 def initialize(params) super(params) @identifier = params[:identifier] resolve_frame_optimized unless $refs.has_key?(@identifier) $refs[@identifier] = @name $refs_frame_optimized[@identifier] = @frame_optimized else raise "duplicate ref definition #{params[:name]}" end end |
Instance Attribute Details
#identifier ⇒ Object
Returns the value of attribute identifier.
6 7 8 |
# File 'lib/functions/create_ref.rb', line 6 def identifier @identifier end |
#value ⇒ Object
Returns the value of attribute value.
7 8 9 |
# File 'lib/functions/create_ref.rb', line 7 def value @value end |
Instance Method Details
#arduino_code ⇒ Object
25 26 27 |
# File 'lib/functions/create_ref.rb', line 25 def arduino_code [] end |
#param_keys ⇒ Object
21 22 23 |
# File 'lib/functions/create_ref.rb', line 21 def param_keys [:value] end |
#top_level_scope_code ⇒ Object
29 30 31 32 33 |
# File 'lib/functions/create_ref.rb', line 29 def top_level_scope_code [ "long *#{@name} = #{@value.name};" ] end |