Class: RspecSprint::Normalizer::Factory

Inherits:
Struct
  • Object
show all
Defined in:
lib/rspec_sprint/normalizer.rb

Overview

One factory’s profile. top_level_ratio is the cascade signal: low ratio means the factory is built mostly via associations, not directly.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



13
14
15
# File 'lib/rspec_sprint/normalizer.rb', line 13

def name
  @name
end

#top_level_countObject

Returns the value of attribute top_level_count

Returns:

  • (Object)

    the current value of top_level_count



13
14
15
# File 'lib/rspec_sprint/normalizer.rb', line 13

def top_level_count
  @top_level_count
end

#total_countObject

Returns the value of attribute total_count

Returns:

  • (Object)

    the current value of total_count



13
14
15
# File 'lib/rspec_sprint/normalizer.rb', line 13

def total_count
  @total_count
end

#total_timeObject

Returns the value of attribute total_time

Returns:

  • (Object)

    the current value of total_time



13
14
15
# File 'lib/rspec_sprint/normalizer.rb', line 13

def total_time
  @total_time
end

Instance Method Details

#top_level_ratioObject



14
15
16
17
18
# File 'lib/rspec_sprint/normalizer.rb', line 14

def top_level_ratio
  return 0.0 if total_count.nil? || total_count.zero?

  top_level_count.to_f / total_count
end