Class: JayAPI::Mergeables::MergeSelector::Configuration

Inherits:
Configuration
  • Object
show all
Defined in:
lib/jay_api/mergeables/merge_selector/configuration.rb

Overview

A child class of Configuration, that contains the functionality that allows the Configuration objects ‘merge’ with each other.

Instance Method Summary collapse

Methods inherited from Configuration

#deep_to_h, from_file, from_string, #keys, #to_yaml, #with_merge_selector

Instance Method Details

#merge_select(other) ⇒ JayAPI::Mergeables::MergeSelector::Configuration

Returns The result of the ‘merge’ between ‘self’ and ‘other’.

Parameters:

  • other (JayAPI::Configuration, Hash)

    The element with which the ‘self’ object will be ‘merged’.

Returns:



18
19
20
21
22
23
24
25
# File 'lib/jay_api/mergeables/merge_selector/configuration.rb', line 18

def merge_select(other)
  self.class.from_hash(
    Merger.new(
      with_indifferent_access,
      other.with_indifferent_access
    ).to_h
  )
end