module SubDiff::Buildable

This module allows classes to accept a {Builder} object as an initializer argument and defines an `attr_reader` for it.

It also delegates commonly used methods to the {Builder} instance.

Used internally by {Adapter}, {Differ}, and {Sub}.

@api private

Attributes

builder[R]

Public Class Methods

included(base) click to toggle source
   # File lib/sub_diff/buildable.rb
17 def self.included(base)
18   base.extend(Forwardable)
19   base.def_delegators(:builder, :diff_method, :differ, :string)
20 end
new(builder) click to toggle source
   # File lib/sub_diff/buildable.rb
13 def initialize(builder)
14   @builder = builder
15 end