Class: Metanorma::Release::ManifestEntry
- Inherits:
-
Object
- Object
- Metanorma::Release::ManifestEntry
- Defined in:
- lib/metanorma/release/channel_manifest.rb
Instance Attribute Summary collapse
-
#channels ⇒ Object
readonly
Returns the value of attribute channels.
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#stages ⇒ Object
readonly
Returns the value of attribute stages.
-
#visibility ⇒ Object
readonly
Returns the value of attribute visibility.
Instance Method Summary collapse
-
#initialize(source:, pattern:, visibility:, channels:, stages:) ⇒ ManifestEntry
constructor
A new instance of ManifestEntry.
- #match_priority ⇒ Object
- #stages_set ⇒ Object
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
#channels ⇒ Object (readonly)
Returns the value of attribute channels.
48 49 50 |
# File 'lib/metanorma/release/channel_manifest.rb', line 48 def channels @channels end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
48 49 50 |
# File 'lib/metanorma/release/channel_manifest.rb', line 48 def pattern @pattern end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
48 49 50 |
# File 'lib/metanorma/release/channel_manifest.rb', line 48 def source @source end |
#stages ⇒ Object (readonly)
Returns the value of attribute stages.
48 49 50 |
# File 'lib/metanorma/release/channel_manifest.rb', line 48 def stages @stages end |
#visibility ⇒ Object (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_priority ⇒ Object
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_set ⇒ Object
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 |