Class: Applitools::BatchInfo

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of BatchInfo.



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

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

Instance Attribute Details

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#started_atObject

Returns the value of attribute started_at.



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

def started_at
  @started_at
end

Instance Method Details

#to_hashObject



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

def to_hash
  {
    'id' => @id,
    'name' => @name,
    'startedAt' => @started_at.iso8601
  }
end

#to_sObject



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

def to_s
  to_hash.to_s
end