Class: Diggit::RunnableEntry

Inherits:
Object
  • Object
show all
Includes:
EntryWithError
Defined in:
lib/dgit/entries.rb

Instance Attribute Summary collapse

Attributes included from EntryWithError

#error

Instance Method Summary collapse

Constructor Details

#initialize(runnable) ⇒ RunnableEntry

Returns a new instance of RunnableEntry.



96
97
98
99
100
# File 'lib/dgit/entries.rb', line 96

def initialize(runnable)
	@name = runnable.name
	@end = nil
	tic
end

Instance Attribute Details

#endObject

Returns the value of attribute end.



94
95
96
# File 'lib/dgit/entries.rb', line 94

def end
  @end
end

#nameObject

Returns the value of attribute name.



94
95
96
# File 'lib/dgit/entries.rb', line 94

def name
  @name
end

#startObject

Returns the value of attribute start.



94
95
96
# File 'lib/dgit/entries.rb', line 94

def start
  @start
end

Instance Method Details

#durationObject



114
115
116
# File 'lib/dgit/entries.rb', line 114

def duration
	@end - @start
end

#error?Boolean

Returns:

  • (Boolean)


102
103
104
# File 'lib/dgit/entries.rb', line 102

def error?
	!@error.nil?
end

#ticObject



106
107
108
# File 'lib/dgit/entries.rb', line 106

def tic
	@start = Time.now
end

#tocObject



110
111
112
# File 'lib/dgit/entries.rb', line 110

def toc
	@end = Time.now
end