123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Core::Ordering::Delayed Private

Relationships & Source Files
Inherits: Object
Defined in: rspec-core/lib/rspec/core/ordering.rb

Overview

A strategy which delays looking up the ordering until needed

Class Method Summary

Instance Method Summary

Constructor Details

.new(registry, name) ⇒ Delayed

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/ordering.rb', line 84

def initialize(registry, name)
  @registry = registry
  @name = name
end

Instance Method Details

#lookup_strategy (private)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/ordering.rb', line 99

def lookup_strategy
  raise "Undefined ordering strategy #{@name.inspect}" unless @registry.has_strategy?(@name)
  @registry.fetch(@name)
end

#order(list)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/ordering.rb', line 89

def order(list)
  strategy.order(list)
end

#strategy (private)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/ordering.rb', line 95

def strategy
  @strategy ||= lookup_strategy
end