Module: BubbleWrap::Device
- Defined in:
- motion/core/device.rb,
motion/core/device/screen.rb
Defined Under Namespace
Modules: Screen
Class Method Summary (collapse)
-
+ (TrueClass, FalseClass) front_camera?(picker = UIImagePickerController)
Verifies that the device running has a front facing camera.
-
+ (TrueClass, FalseClass) ipad?(idiom = UIDevice.currentDevice.userInterfaceIdiom)
Verifies that the device running the app is an iPad.
-
+ (TrueClass, FalseClass) iphone?(idiom = UIDevice.currentDevice.userInterfaceIdiom)
Verifies that the device running the app is an iPhone.
-
+ (Object) orientation
Delegates to BubbleWrap::Screen.orientation.
-
+ (TrueClass, FalseClass) rear_camera?(picker = UIImagePickerController)
Verifies that the device running has a rear facing camera.
-
+ (Boolean) retina?
Delegates to BubbleWrap::Screen.retina?.
-
+ (Object) screen
Shameless shorthand for accessing BubbleWrap::Screen.
- + (Boolean) simulator?
Class Method Details
+ (TrueClass, FalseClass) front_camera?(picker = UIImagePickerController)
Verifies that the device running has a front facing camera.
19 20 21 |
# File 'motion/core/device.rb', line 19 def front_camera?(picker=UIImagePickerController) picker.isCameraDeviceAvailable(UIImagePickerControllerCameraDeviceFront) end |
+ (TrueClass, FalseClass) ipad?(idiom = UIDevice.currentDevice.userInterfaceIdiom)
Verifies that the device running the app is an iPad.
13 14 15 |
# File 'motion/core/device.rb', line 13 def ipad?(idiom=UIDevice.currentDevice.userInterfaceIdiom) idiom == UIUserInterfaceIdiomPad end |
+ (TrueClass, FalseClass) iphone?(idiom = UIDevice.currentDevice.userInterfaceIdiom)
Verifies that the device running the app is an iPhone.
7 8 9 |
# File 'motion/core/device.rb', line 7 def iphone?(idiom=UIDevice.currentDevice.userInterfaceIdiom) idiom == UIUserInterfaceIdiomPhone end |
+ (Object) orientation
Delegates to BubbleWrap::Screen.orientation
44 45 46 |
# File 'motion/core/device.rb', line 44 def orientation screen.orientation end |
+ (TrueClass, FalseClass) rear_camera?(picker = UIImagePickerController)
Verifies that the device running has a rear facing camera.
25 26 27 |
# File 'motion/core/device.rb', line 25 def rear_camera?(picker=UIImagePickerController) picker.isCameraDeviceAvailable(UIImagePickerControllerCameraDeviceRear) end |
+ (Boolean) retina?
Delegates to BubbleWrap::Screen.retina?
39 40 41 |
# File 'motion/core/device.rb', line 39 def retina? screen.retina? end |
+ (Object) screen
Shameless shorthand for accessing BubbleWrap::Screen
34 35 36 |
# File 'motion/core/device.rb', line 34 def screen BubbleWrap::Device::Screen end |
+ (Boolean) simulator?
29 30 31 |
# File 'motion/core/device.rb', line 29 def simulator? @simulator_state ||= !(UIDevice.currentDevice.model =~ /simulator/i).nil? end |