Class: CC::Config::Prepare::Fetch

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

Defined Under Namespace

Classes: Entry

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entries = []) ⇒ Fetch

Returns a new instance of Fetch.



29
30
31
# File 'lib/cc/config/prepare.rb', line 29

def initialize(entries = [])
  @entries = Set.new(entries)
end

Class Method Details

.from_data(data) ⇒ Object



25
26
27
# File 'lib/cc/config/prepare.rb', line 25

def self.from_data(data)
  new(data.map { |d| Entry.from_data(d) })
end

Instance Method Details

#each(&block) ⇒ Object



33
34
35
# File 'lib/cc/config/prepare.rb', line 33

def each(&block)
  entries.each(&block)
end

#merge(other) ⇒ Object



41
42
43
# File 'lib/cc/config/prepare.rb', line 41

def merge(other)
  Fetch.new(each.to_a | other.each.to_a)
end

#pathsObject



37
38
39
# File 'lib/cc/config/prepare.rb', line 37

def paths
  entries.map(&:path)
end