Module: SubDiff::Buildable Private

Included in:
Adapter, Differ, Sub
Defined in:
lib/sub_diff/buildable.rb

Overview

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

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.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#builderObject (readonly)

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.


11
12
13
# File 'lib/sub_diff/buildable.rb', line 11

def builder
  @builder
end

Class Method Details

.included(base) ⇒ Object

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.


17
18
19
20
# File 'lib/sub_diff/buildable.rb', line 17

def self.included(base)
  base.extend(Forwardable)
  base.def_delegators(:builder, :diff_method, :differ, :string)
end

Instance Method Details

#initialize(builder) ⇒ Object

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.


13
14
15
# File 'lib/sub_diff/buildable.rb', line 13

def initialize(builder)
  @builder = builder
end