Class: ExecutionLog

Inherits:
Object
  • Object
show all
Defined in:
lib/logs/execution_log.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeExecutionLog

Returns a new instance of ExecutionLog.



11
12
13
14
# File 'lib/logs/execution_log.rb', line 11

def initialize
  @host = Socket.gethostname
  @startDate = Time.now.to_ms
end

Instance Attribute Details

#endDateObject

Returns the value of attribute endDate.



9
10
11
# File 'lib/logs/execution_log.rb', line 9

def endDate
  @endDate
end

#executionIdObject

Returns the value of attribute executionId.



9
10
11
# File 'lib/logs/execution_log.rb', line 9

def executionId
  @executionId
end

#hostObject

Returns the value of attribute host.



9
10
11
# File 'lib/logs/execution_log.rb', line 9

def host
  @host
end

#startDateObject

Returns the value of attribute startDate.



9
10
11
# File 'lib/logs/execution_log.rb', line 9

def startDate
  @startDate
end

Class Method Details

.from_json(data) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/logs/execution_log.rb', line 16

def self.from_json data
  executionLog = ExecutionLog.new
  executionLog.executionId = data['execution_id']
  executionLog.startDate = data['start_date']
  executionLog.endDate = data['end_date']
  executionLog.host = data['host']
  executionLog
end

Instance Method Details

#to_json(options = {}) ⇒ Object



25
26
27
# File 'lib/logs/execution_log.rb', line 25

def to_json(options={})
  {'execution_id' => @executionId, 'start_date' => @startDate, 'end_date' => @endDate, 'host' => @host}.to_json
end