Class: Steep::Services::StatsCalculator::SuccessStats

Inherits:
Struct
  • Object
show all
Defined in:
lib/steep/services/stats_calculator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#error_calls_countObject

Returns the value of attribute error_calls_count

Returns:

  • (Object)

    the current value of error_calls_count



4
5
6
# File 'lib/steep/services/stats_calculator.rb', line 4

def error_calls_count
  @error_calls_count
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



4
5
6
# File 'lib/steep/services/stats_calculator.rb', line 4

def path
  @path
end

#targetObject

Returns the value of attribute target

Returns:

  • (Object)

    the current value of target



4
5
6
# File 'lib/steep/services/stats_calculator.rb', line 4

def target
  @target
end

#typed_calls_countObject

Returns the value of attribute typed_calls_count

Returns:

  • (Object)

    the current value of typed_calls_count



4
5
6
# File 'lib/steep/services/stats_calculator.rb', line 4

def typed_calls_count
  @typed_calls_count
end

#untyped_calls_countObject

Returns the value of attribute untyped_calls_count

Returns:

  • (Object)

    the current value of untyped_calls_count



4
5
6
# File 'lib/steep/services/stats_calculator.rb', line 4

def untyped_calls_count
  @untyped_calls_count
end

Instance Method Details

#as_jsonObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/steep/services/stats_calculator.rb', line 5

def as_json
  {
    type: "success",
    target: target.name.to_s,
    path: path.to_s,
    typed_calls: typed_calls_count,
    untyped_calls: untyped_calls_count,
    error_calls: error_calls_count,
    total_calls: typed_calls_count + untyped_calls_count + error_calls_count
  }
end