lib/misp/galaxy.rb in misp-0.1.1 vs lib/misp/galaxy.rb in misp-0.1.2
- old
+ new
@@ -17,11 +17,11 @@
# @return [Array<MISP::GalaxyCluster>]
attr_reader :galaxy_clusters
def initialize(**attributes)
- attributes = normalize_attributes(attributes)
+ attributes = normalize_attributes(**attributes)
@id = attributes.dig(:id)
@uuid = attributes.dig(:uuid)
@name = attributes.dig(:name)
@type = attributes.dig(:type)
@@ -54,21 +54,21 @@
# @return [Array<Galaxy>]
#
def list
_get("/galaxies/") do |galaxies|
galaxies.map do |galaxy|
- Galaxy.new galaxy
+ Galaxy.new(**galaxy)
end
end
end
#
# Get a galaxy
#
# @return [MISP::Galaxy]
#
def get
- _get("/galaxies/view/#{id}") { |galaxy| Galaxy.new galaxy }
+ _get("/galaxies/view/#{id}") { |galaxy| Galaxy.new(**galaxy) }
end
class << self
def list
new.list