Class: RedShift::Component::ContVarAttribute

Inherits:
CNativeAttribute
  • Object
show all
Defined in:
lib/redshift/target/c/component-gen.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ ContVarAttribute

Returns a new instance of ContVarAttribute.



93
94
95
96
97
98
# File 'lib/redshift/target/c/component-gen.rb', line 93

def initialize(*args)
  super
  # value[0] is the relevant state outside of continuous update
  @dump = "rb_ary_push(result, rb_float_new(shadow->#{@cvar}.value[0]))"
  @load = "shadow->#{@cvar}.value[0] = NUM2DBL(rb_ary_shift(from_array))"
end