module InvertedPendulum::DSL
Public Instance Methods
cart(&block)
click to toggle source
# File neater/rnlib/inverted_pendulum.rb, line 360 def cart(&block) @cart_params = block.() unless @cart_params[:naked] @cart = @ipwin.cart = Cart.new({ipwin: @ipwin}.merge @cart_params) else @cart = Cart.new(@cart_params) end end
invpend(&block)
click to toggle source
# File neater/rnlib/inverted_pendulum.rb, line 357 def invpend(&block) @ipwin = InvPendWindow.new def cart(&block) @cart_params = block.() unless @cart_params[:naked] @cart = @ipwin.cart = Cart.new({ipwin: @ipwin}.merge @cart_params) else @cart = Cart.new(@cart_params) end end def show(cart: @cart, &block) unless cart.nil? @ipwin.cart = cart cart.ipwin = @ipwin end @ipwin.show end block.(@ipwin) end
show(cart: @cart, &block)
click to toggle source
# File neater/rnlib/inverted_pendulum.rb, line 369 def show(cart: @cart, &block) unless cart.nil? @ipwin.cart = cart cart.ipwin = @ipwin end @ipwin.show end