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.



97
98
99
100
101
102
# File 'lib/redshift/target/c/component-gen.rb', line 97

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