Class: Oscal::OscalArray

Inherits:
Array
  • Object
show all
Includes:
ParsingLogger
Defined in:
lib/oscal/list.rb

Instance Method Summary collapse

Methods included from ParsingLogger

#get_logger, logger=

Constructor Details

#initialize(input) ⇒ OscalArray

Returns a new instance of OscalArray.



16
17
18
19
20
21
# File 'lib/oscal/list.rb', line 16

def initialize(input)
  super
  @logger = get_logger
  @logger.debug("#{self.class}.new called with #{input.to_s[0, 25]}")
  validate_member_type(input)
end

Instance Method Details

#validate_member_type(input) ⇒ Object



9
10
11
12
13
14
# File 'lib/oscal/list.rb', line 9

def validate_member_type(input)
  @logger.debug("Validating array members are #{self.class::MEMBER_TYPE}")
  input.map do |item|
    self.class::MEMBER_TYPE.new(item)
  end
end