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.



98
99
100
101
102
# File 'lib/dgit/entries.rb', line 98

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

Instance Attribute Details

#endObject

Returns the value of attribute end.



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

def end
  @end
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#startObject

Returns the value of attribute start.



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

def start
  @start
end

Instance Method Details

#durationObject



116
117
118
# File 'lib/dgit/entries.rb', line 116

def duration
	@end - @start
end

#error?Boolean

Returns:

  • (Boolean)


104
105
106
# File 'lib/dgit/entries.rb', line 104

def error?
	!@error.nil?
end

#ticObject



108
109
110
# File 'lib/dgit/entries.rb', line 108

def tic
	@start = Time.now
end

#tocObject



112
113
114
# File 'lib/dgit/entries.rb', line 112

def toc
	@end = Time.now
end