Class: Etcher::Builder

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

Overview

Builds a configuration.

Instance Method Summary collapse

Constructor Details

#initialize(registry = Registry.new) ⇒ Builder

Returns a new instance of Builder.



14
15
16
# File 'lib/etcher/builder.rb', line 14

def initialize registry = Registry.new
  @registry = registry
end

Instance Method Details

#call(**overrides) ⇒ Object



18
19
20
21
22
23
# File 'lib/etcher/builder.rb', line 18

def call(**overrides)
  load.bind { |attributes| transform attributes }
      .fmap { |attributes| attributes.merge! overrides.symbolize_keys! }
      .bind { |attributes| validate attributes }
      .bind { |attributes| model attributes }
end