Class: ExecutionLog
- Inherits:
-
Object
- Object
- ExecutionLog
- Defined in:
- lib/logs/execution_log.rb
Instance Attribute Summary collapse
-
#endDate ⇒ Object
Returns the value of attribute endDate.
-
#executionId ⇒ Object
Returns the value of attribute executionId.
-
#host ⇒ Object
Returns the value of attribute host.
-
#startDate ⇒ Object
Returns the value of attribute startDate.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ ExecutionLog
constructor
A new instance of ExecutionLog.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize ⇒ ExecutionLog
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
#endDate ⇒ Object
Returns the value of attribute endDate.
9 10 11 |
# File 'lib/logs/execution_log.rb', line 9 def endDate @endDate end |
#executionId ⇒ Object
Returns the value of attribute executionId.
9 10 11 |
# File 'lib/logs/execution_log.rb', line 9 def executionId @executionId end |
#host ⇒ Object
Returns the value of attribute host.
9 10 11 |
# File 'lib/logs/execution_log.rb', line 9 def host @host end |
#startDate ⇒ Object
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(={}) {'execution_id' => @executionId, 'start_date' => @startDate, 'end_date' => @endDate, 'host' => @host}.to_json end |