Class: CC::Config::Prepare

Inherits:
Object
  • Object
show all
Defined in:
lib/cc/config/prepare.rb

Defined Under Namespace

Classes: Fetch

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fetch: Fetch.new) ⇒ Prepare

Returns a new instance of Prepare.



16
17
18
# File 'lib/cc/config/prepare.rb', line 16

def initialize(fetch: Fetch.new)
  @fetch = fetch
end

Instance Attribute Details

#fetchObject (readonly)

Returns the value of attribute fetch.



4
5
6
# File 'lib/cc/config/prepare.rb', line 4

def fetch
  @fetch
end

Class Method Details

.from_data(data) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/cc/config/prepare.rb', line 6

def self.from_data(data)
  if data.present?
    fetch = Fetch.from_data(data.fetch("fetch", []))

    new(fetch: fetch)
  else
    new
  end
end

Instance Method Details

#merge(other) ⇒ Object



20
21
22
# File 'lib/cc/config/prepare.rb', line 20

def merge(other)
  Prepare.new(fetch: fetch.merge(other.fetch))
end