Class: ArticleFixtureGen::Config::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/article_fixture_gen/config/builder.rb

Overview

Builds hash with correct keys based on input. What’s the value of this, you ask? Two things:

  1. It defines ‘*_given` entries which are `true` if their corresponding entries are specified, whether those other entries are truthy or not;

  2. It confirms filtering of the input hash, offering a guarantee that any entry accepted is one supported elsehwere in our code.

And yes, this class is awfully procedural. Got ideas for a fix? We’d appreciate your PR!

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(options_hash) ⇒ Object



21
22
23
# File 'lib/article_fixture_gen/config/builder.rb', line 21

def self.call(options_hash)
  new.call options_hash
end

Instance Method Details

#call(options) ⇒ Object



25
26
27
28
# File 'lib/article_fixture_gen/config/builder.rb', line 25

def call(options)
  @options = options
  hashes
end