Class: Applitools::TextTrigger

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

Constant Summary collapse

TRIGGER_TYPE =
:Text

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Trigger

#trigger_type

Constructor Details

#initialize(text, control) ⇒ TextTrigger

Returns a new instance of TextTrigger.



7
8
9
10
# File 'lib/applitools/core/text_trigger.rb', line 7

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

Instance Attribute Details

#controlObject (readonly)

Returns the value of attribute control.



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

def control
  @control
end

#textObject (readonly)

Returns the value of attribute text.



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

def text
  @text
end

Instance Method Details

#to_hashObject



12
13
14
15
16
17
18
# File 'lib/applitools/core/text_trigger.rb', line 12

def to_hash
  {
    triggerType: trigger_type,
    text: text,
    control: control.to_hash
  }
end

#to_sObject



20
21
22
# File 'lib/applitools/core/text_trigger.rb', line 20

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