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.



9
10
11
12
# File 'lib/applitools/core/text_trigger.rb', line 9

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

Instance Attribute Details

#controlObject (readonly)

Returns the value of attribute control.



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

def control
  @control
end

#textObject (readonly)

Returns the value of attribute text.



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

def text
  @text
end

Instance Method Details

#to_hashObject



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

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

#to_sObject



22
23
24
# File 'lib/applitools/core/text_trigger.rb', line 22

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