Class: Applitools::Base::TextTrigger

Inherits:
Object
  • Object
show all
Defined in:
lib/applitools/base/text_trigger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, control) ⇒ TextTrigger

Returns a new instance of TextTrigger.



5
6
7
8
# File 'lib/applitools/base/text_trigger.rb', line 5

def initialize(text, control)
  @text = text
  @control = control
end

Instance Attribute Details

#controlObject (readonly)

Returns the value of attribute control.



3
4
5
# File 'lib/applitools/base/text_trigger.rb', line 3

def control
  @control
end

#textObject (readonly)

Returns the value of attribute text.



3
4
5
# File 'lib/applitools/base/text_trigger.rb', line 3

def text
  @text
end

Instance Method Details

#to_hashObject



10
11
12
13
14
15
16
# File 'lib/applitools/base/text_trigger.rb', line 10

def to_hash
  {
    trigget_type: 'Text',
    text: text,
    control: control.to_hash
  }
end

#to_sObject



18
19
20
# File 'lib/applitools/base/text_trigger.rb', line 18

def to_s
  "Text [#{@control}] #{@text}"
end