Class: Applitools::BatchInfo
- Inherits:
-
Object
- Object
- Applitools::BatchInfo
- Extended by:
- Helpers
- Defined in:
- lib/applitools/core/batch_info.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#notify_on_completion ⇒ Object
Returns the value of attribute notify_on_completion.
-
#started_at ⇒ Object
Returns the value of attribute started_at.
Instance Method Summary collapse
-
#initialize(name = nil, started_at = Time.now) ⇒ BatchInfo
constructor
A new instance of BatchInfo.
- #json_data ⇒ Object
- #to_hash ⇒ Object
- #to_s ⇒ Object
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.
17 18 19 20 21 22 |
# File 'lib/applitools/core/batch_info.rb', line 17 def initialize(name = nil, started_at = Time.now) self.name = name if name @started_at = started_at self.id = SecureRandom.uuid unless id self.notify_on_completion = 'true'.casecmp(env_notify_on_completion || '') == 0 ? true : false end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
9 10 11 |
# File 'lib/applitools/core/batch_info.rb', line 9 def id @id end |
#notify_on_completion ⇒ Object
Returns the value of attribute notify_on_completion.
9 10 11 |
# File 'lib/applitools/core/batch_info.rb', line 9 def notify_on_completion @notify_on_completion end |
#started_at ⇒ Object
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
#json_data ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/applitools/core/batch_info.rb', line 24 def json_data { 'id' => id, 'name' => name, 'startedAt' => @started_at.iso8601, 'batchSequenceName' => sequence_name, 'notifyOnCompletion' => notify_on_completion } end |
#to_hash ⇒ Object
34 35 36 |
# File 'lib/applitools/core/batch_info.rb', line 34 def to_hash json_data end |
#to_s ⇒ Object
38 39 40 |
# File 'lib/applitools/core/batch_info.rb', line 38 def to_s to_hash.to_s end |