Class: MobyCommand::ScreenCapture

Inherits:
CommandData show all
Defined in:
lib/tdriver/base/sut/generic/commands/screen_capture.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from CommandData

#get_application_id, #get_sut, #set_application_uid, #set_sut

Constructor Details

#initialize(attributes = {}) ⇒ ScreenCapture

Constructor to ScreenCapture

params

attributes

(optional) Hash of image related attributes

returns

Instance of ScreenCapture



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/tdriver/base/sut/generic/commands/screen_capture.rb', line 37

def initialize( attributes = {} )

    # verify that attributes argument is type of Hash
    attributes.check_type( Hash, "Wrong argument type $1 for screen capture command attributes (expected $2)" )

    # set default values unless already defined in attributes hash
    attributes.default_values( :type => :Screen, :mime_type => :PNG, :color_depth => :Color4K, :redraw => false )

    # verify that value of :type is type of Symbol
    ( @command = attributes[ :type ] ).check_type( Symbol, "Wrong argument type $1 for screen capture command type (expected $2)" )

    # verify that value of :mime_type is type of Symbol
    ( @image_mime_type = attributes[ :mime_type ] ).check_type( Symbol, "Wrong argument type $1 for screen capture command mime type (expected $2)" )

    # verify that value of :color_depth is type of Symbol
    ( @color_depth = attributes[ :color_depth ] ).check_type( Symbol, "Wrong argument type $1 for screen capture command image color depth type (expected $2)" )

    # verify that value of :redraw is type of Symbol
    ( @redraw = attributes[ :redraw ] ).check_type( [ TrueClass, FalseClass ], "Wrong argument type $1 for screen capture command redraw flag (expected $2)" )
  
end

Instance Attribute Details

#color_depthObject

Returns the value of attribute color_depth.



25
26
27
# File 'lib/tdriver/base/sut/generic/commands/screen_capture.rb', line 25

def color_depth
  @color_depth
end

#commandObject

Returns the value of attribute command.



25
26
27
# File 'lib/tdriver/base/sut/generic/commands/screen_capture.rb', line 25

def command
  @command
end

#image_mime_typeObject

Returns the value of attribute image_mime_type.



25
26
27
# File 'lib/tdriver/base/sut/generic/commands/screen_capture.rb', line 25

def image_mime_type
  @image_mime_type
end

#redrawObject

Returns the value of attribute redraw.



25
26
27
# File 'lib/tdriver/base/sut/generic/commands/screen_capture.rb', line 25

def redraw
  @redraw
end