class CSP::DirectiveValue::SerializedSourceList

rubocop:enable Lint/NonDeterministicRequireOrder, Style/StringConcatenation

Constants

SOURCE_LIST

Attributes

sources[R]

Public Class Methods

new(value_str) click to toggle source
Calls superclass method CSP::DirectiveValue::Base::new
# File lib/directive_value/serialized_source_list.rb, line 23
def initialize(value_str)
  super

  @sources = @value_str.split.map do |source_str|
    source = SOURCE_LIST.lazy.map do |s|
      s.new(source_str)
    rescue
      nil
    end.find(&:itself)

    source
  end
end

Private Instance Methods

regexp() click to toggle source
# File lib/directive_value/serialized_source_list.rb, line 39
def regexp
  /\A#{CSP::Grammar::SERIALIZED_SOURCE_LIST}\z/o
end