Class: Metanorma::Release::ManifestEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/metanorma/release/channel_manifest.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source:, pattern:, visibility:, channels:, stages:) ⇒ ManifestEntry

Returns a new instance of ManifestEntry.



50
51
52
53
54
55
56
57
# File 'lib/metanorma/release/channel_manifest.rb', line 50

def initialize(source:, pattern:, visibility:, channels:, stages:)
  @source = source
  @pattern = pattern
  @visibility = visibility
  @channels = channels
  @stages = stages
  freeze
end

Instance Attribute Details

#channelsObject (readonly)

Returns the value of attribute channels.



48
49
50
# File 'lib/metanorma/release/channel_manifest.rb', line 48

def channels
  @channels
end

#patternObject (readonly)

Returns the value of attribute pattern.



48
49
50
# File 'lib/metanorma/release/channel_manifest.rb', line 48

def pattern
  @pattern
end

#sourceObject (readonly)

Returns the value of attribute source.



48
49
50
# File 'lib/metanorma/release/channel_manifest.rb', line 48

def source
  @source
end

#stagesObject (readonly)

Returns the value of attribute stages.



48
49
50
# File 'lib/metanorma/release/channel_manifest.rb', line 48

def stages
  @stages
end

#visibilityObject (readonly)

Returns the value of attribute visibility.



48
49
50
# File 'lib/metanorma/release/channel_manifest.rb', line 48

def visibility
  @visibility
end

Instance Method Details

#match_priorityObject



59
60
61
62
63
64
# File 'lib/metanorma/release/channel_manifest.rb', line 59

def match_priority
  return 100 if source
  return 50 + pattern.to_s.length if pattern

  0
end

#stages_setObject



66
67
68
69
70
# File 'lib/metanorma/release/channel_manifest.rb', line 66

def stages_set
  return nil if stages.nil? || stages.empty?

  Set.new(stages.map(&:downcase))
end