Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
fix: fix Rubocop issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ninoseki committed Mar 8, 2020
1 parent a028872 commit dfcd382
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions lib/misp/attribute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def delete
# @return [MISP::Attribute]
#
def create(event_id)
_post("/attributes/add/#{event_id}", wrap(to_h)) { |attribute| Attribute.new **attribute }
_post("/attributes/add/#{event_id}", wrap(to_h)) { |attribute| Attribute.new(**attribute) }
end

#
Expand All @@ -125,7 +125,7 @@ def create(event_id)
def update(**attrs)
payload = to_h.merge(attrs)
payload[:timestamp] = nil
_post("/attributes/edit/#{id}", wrap(payload)) { |json| Attribute.new **json.dig(:response, :Attribute) }
_post("/attributes/edit/#{id}", wrap(payload)) { |json| Attribute.new(**json.dig(:response, :Attribute)) }
end

#
Expand Down Expand Up @@ -158,7 +158,7 @@ def search(**params)
def add_tag(tag)
tag = Tag.new(tag) unless tag.is_a?(MISP::Tag)
payload = { uuid: uuid, tag: tag.name }
_post("/tags/attachTagToObject", payload) { |json| Tag.new **json }
_post("/tags/attachTagToObject", payload) { |json| Tag.new(**json) }
end

#
Expand Down
8 changes: 4 additions & 4 deletions lib/misp/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def to_h
# @return [MISP::Event]
#
def get(id)
_get("/events/#{id}") { |event| Event.new **event }
_get("/events/#{id}") { |event| Event.new(**event) }
end

#
Expand All @@ -144,7 +144,7 @@ def get(id)
#
def create(**attrs)
payload = to_h.merge(attrs)
_post("/events/add", wrap(payload)) { |event| Event.new **event }
_post("/events/add", wrap(payload)) { |event| Event.new(**event) }
end

#
Expand All @@ -164,7 +164,7 @@ def delete
def list
_get("/events/index") do |events|
events.map do |event|
Event.new **event
Event.new(**event)
end
end
end
Expand Down Expand Up @@ -226,7 +226,7 @@ def get(id)
end

def create(**attrs)
new.create **attrs
new.create(**attrs)
end

def delete(id)
Expand Down
2 changes: 1 addition & 1 deletion lib/misp/feed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def to_h
def list
_get("/feeds/index") do |feeds|
feeds.map do |feed|
Feed.new **feed
Feed.new(**feed)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/misp/sharing_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def list
_get("/sharing_groups/") do |res|
sharing_groups = res.dig(:response) || []
sharing_groups.map do |sharing_group|
SharingGroup.new **sharing_group
SharingGroup.new(**sharing_group)
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/misp/tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def to_h
# @return [MISP::Tag]
#
def get
_get("/tags/view/#{id}") { |json| Tag.new **json }
_get("/tags/view/#{id}") { |json| Tag.new(**json) }
end

#
Expand Down Expand Up @@ -76,7 +76,7 @@ def delete
#
def update(**attributes)
payload = to_h.merge(attributes)
_post("/tags/edit/#{id}", wrap(payload)) { |json| Tag.new **json }
_post("/tags/edit/#{id}", wrap(payload)) { |json| Tag.new(**json) }
end

#
Expand Down
2 changes: 1 addition & 1 deletion spec/org_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

RSpec.describe MISP::Org do
subject { described_class.new **attributes }
subject { described_class.new(**attributes) }

let(:id) { 1 }
let(:name) { "test" }
Expand Down
2 changes: 1 addition & 1 deletion spec/sharing_group_server_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

RSpec.describe MISP::SharingGroupServer do
subject { described_class.new **attributes }
subject { described_class.new(**attributes) }

let(:attributes) {
{ all_orgs: true, server_id: "0", sharing_group_id: "1", Server: [] }
Expand Down

0 comments on commit dfcd382

Please sign in to comment.