Class: Spek::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/spek/loader.rb

Overview

Loads a gem’s specification.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client: ::Gem::Specification, presenter: Presenter) ⇒ Loader



8
9
10
11
# File 'lib/spek/loader.rb', line 8

def initialize client: ::Gem::Specification, presenter: Presenter
  @client = client
  @presenter = presenter
end

Class Method Details

.call(path) ⇒ Object



6
# File 'lib/spek/loader.rb', line 6

def self.call(path, ...) = new(...).call path

Instance Method Details

#call(path) ⇒ Object



13
# File 'lib/spek/loader.rb', line 13

def call(path) = client.load(path.to_s).then { |record| presenter.with_default record }