iOS device/UI rotation


I am using appium with ruby script. I am able to rotate the device by adding a property in capabilities. Is there a command to rotate the device in run time. I tried this command,, but didn’t work for me.I am getting “appium undefined method `rotation=’” error message. I imported following libs.

require ‘rubygems’
require ‘appium_lib’