class Pipely::ReferenceList

A list of references to Components for managing dependencies

Public Class Methods

new(input) click to toggle source
# File lib/pipely/reference_list.rb, line 9
def initialize(input)
  @raw_references = [input].flatten.compact
end

Public Instance Methods

build_dependencies(label) click to toggle source
# File lib/pipely/reference_list.rb, line 13
def build_dependencies(label)
  @raw_references.map{|h| Dependency.new(label, h['ref'])}
end
present?() click to toggle source
# File lib/pipely/reference_list.rb, line 25
def present?
  !@raw_references.empty?
end
to_json(options={}, depth=0) click to toggle source
# File lib/pipely/reference_list.rb, line 17
def to_json(options={}, depth=0)
  if 1 == @raw_references.count
    @raw_references.first.to_json(options)
  else
    @raw_references.to_json(options)
  end
end