Class: Burden::Statistics
- Inherits:
-
Object
- Object
- Burden::Statistics
- Defined in:
- lib/burden/statistics.rb
Instance Attribute Summary collapse
-
#execution_time ⇒ Object
readonly
Returns the value of attribute execution_time.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#success ⇒ Object
readonly
Returns the value of attribute success.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(params) ⇒ Statistics
constructor
A new instance of Statistics.
- #save ⇒ Object
Constructor Details
#initialize(params) ⇒ Statistics
Returns a new instance of Statistics.
5 6 7 8 9 10 |
# File 'lib/burden/statistics.rb', line 5 def initialize(params) @name = params[:name] @success = params[:success] @execution_time = params[:execution_time] @timestamp = params[:timestamp] end |
Instance Attribute Details
#execution_time ⇒ Object (readonly)
Returns the value of attribute execution_time.
3 4 5 |
# File 'lib/burden/statistics.rb', line 3 def execution_time @execution_time end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/burden/statistics.rb', line 3 def name @name end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
3 4 5 |
# File 'lib/burden/statistics.rb', line 3 def success @success end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
3 4 5 |
# File 'lib/burden/statistics.rb', line 3 def @timestamp end |
Instance Method Details
#save ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/burden/statistics.rb', line 12 def save # FIXME # if Burden.storage.ready? # Burden.storage.runs.create(name: name, success: success, execution_time: execution_time, timestamp: timestamp) # end File.open(Burden.config.log_file, 'a') do |f| f.write() f.close end end |