Sha256: ed7ef45bdbfb50d205c44c6d7b4601ab6cb0a5ce05f837f826825166e091d6d2
Contents?: true
Size: 1012 Bytes
Versions: 1
Compression:
Stored size: 1012 Bytes
Contents
# frozen_string_literal: true module MISP class SharingGroupServer < Base # @return [String] attr_reader :id # @return [String] attr_reader :sharing_group_id # @return [String] attr_reader :server_id # @return [Boolean] attr_reader :all_orgs # @return [Array<MISP::Server>] attr_reader :servers def initialize(**attributes) attributes = normalize_attributes(attributes) @id = attributes.dig(:id) @sharing_group_id = attributes.dig(:sharing_group_id) @server_id = attributes.dig(:server_id) @all_orgs = attributes.dig(:all_orgs) @servers = build_plural_attribute(items: attributes.dig(:Server), klass: Server) end # # Returns a hash representation of the attribute data. # # @return [Hash] # def to_h { id: id, sharing_group_id: sharing_group_id, server_id: server_id, all_orgs: all_orgs, Server: servers.map(&:to_h) }.compact end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
misp-0.1.1 | lib/misp/sharing_group_server.rb |