Class: Motion::Device
- Inherits:
-
Struct
- Object
- Struct
- Motion::Device
- Defined in:
- lib/motion/devices.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#landscape ⇒ Object
Returns the value of attribute landscape.
-
#no_height_label ⇒ Object
Returns the value of attribute no_height_label.
-
#scale ⇒ Object
Returns the value of attribute scale.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height
2 3 4 |
# File 'lib/motion/devices.rb', line 2 def height @height end |
#landscape ⇒ Object
Returns the value of attribute landscape
2 3 4 |
# File 'lib/motion/devices.rb', line 2 def landscape @landscape end |
#no_height_label ⇒ Object
Returns the value of attribute no_height_label
2 3 4 |
# File 'lib/motion/devices.rb', line 2 def no_height_label @no_height_label end |
#scale ⇒ Object
Returns the value of attribute scale
2 3 4 |
# File 'lib/motion/devices.rb', line 2 def scale @scale end |
#width ⇒ Object
Returns the value of attribute width
2 3 4 |
# File 'lib/motion/devices.rb', line 2 def width @width end |
Instance Method Details
#check_screenshots_exists ⇒ Object
20 21 22 23 |
# File 'lib/motion/devices.rb', line 20 def check_screenshots_exists check_screenshot_exists(:portrait) check_screenshot_exists(:landscape) if landscape end |
#filename(orientation) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/motion/devices.rb', line 3 def filename(orientation) if orientation == :portrait size_measurement = height/scale orientation_label = landscape ? '-Portrait' : '' elsif orientation == :landscape size_measurement = width/scale orientation_label = '-Landscape' end size_label = no_height_label ? '' : "-#{size_measurement}h" "Default#{orientation_label}#{size_label}@#{scale}x.png" end |
#filepath(orientation) ⇒ Object
16 17 18 |
# File 'lib/motion/devices.rb', line 16 def filepath(orientation) "#{get_screenshot_path}#{filename(orientation)}" end |