class NVD::JSONFeeds::Schema::Configurations

Represents the `“configurations”` value.

Attributes

nodes[R]

The nodes of the configuration.

@return [Array<Node>]

Public Class Methods

from_json(json) click to toggle source

Maps the parsed JSON to a Symbol Hash for {#initialize}.

@param [Hash{String => Object}] json

@return [Hash{Symbol => Object}]

Calls superclass method
# File lib/nvd/json_feeds/schema/configurations.rb, line 37
def self.from_json(json)
  {
    **super(json),

    nodes: Array(json['nodes']).map(&Node.method(:load))
  }
end
load(json) click to toggle source

Loads the configuration from the parsed JSON.

@param [Hash{String => Object}] json

The parsed JSON.

@return [Cojnfiguration]

The loaded configuration object.
# File lib/nvd/json_feeds/schema/configurations.rb, line 54
def self.load(json)
  new(**from_json(json))
end
new(nodes: [], **kwargs) click to toggle source

Initializes the configuration.

@param [Array<Node>] nodes

# File lib/nvd/json_feeds/schema/configurations.rb, line 24
def initialize(nodes: [], **kwargs)
  super(**kwargs)

  @nodes = nodes
end