Class: Applitools::BatchInfo

Inherits:
Object
  • Object
show all
Extended by:
Helpers
Defined in:
lib/applitools/core/batch_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

abstract_attr_accessor, abstract_method, env_variable, environment_attribute, environment_variables

Constructor Details

#initialize(name = nil, started_at = Time.now) ⇒ BatchInfo

Returns a new instance of BatchInfo.



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

def initialize(name = nil, started_at = Time.now)
  self.name = name if name
  @started_at = started_at
  self.id = SecureRandom.uuid unless id
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#started_atObject

Returns the value of attribute started_at.



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

def started_at
  @started_at
end

Instance Method Details

#to_hashObject



22
23
24
25
26
27
28
29
30
# File 'lib/applitools/core/batch_info.rb', line 22

def to_hash
  {
    'id' => id,
    'name' => name,
    'startedAt' => @started_at.iso8601,
    'batchSequenceName' => sequence_name,
    'notifyOnCompletion' => 'true'.casecmp(notify_on_completion || '') == 0 ? true : false
  }
end

#to_sObject



32
33
34
# File 'lib/applitools/core/batch_info.rb', line 32

def to_s
  to_hash.to_s
end