Method: Serial::Builder.build

Defined in:
lib/serial/builder.rb

.build(context, *args) {|self, *args| ... } ⇒ #data

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Create the builder, execute the block inside it, and return its’ data. Any superflous arguments are given to #exec.

Parameters:

  • context (#instance_exec, nil)

    the context to execute block inside

Yields:

  • (self, *args)

Yield Parameters:

  • self (Builder)

    passes in self as the first parameter.

  • *args

    superflous arguments are passed to the block.

Returns:



13
14
15
16
17
# File 'lib/serial/builder.rb', line 13

def self.build(context, *args, &block)
  builder = new(context)
  builder.exec(*args, &block)
  builder.data
end