From 958be778bac0ba642581185c4cd9282ee2cffb62 Mon Sep 17 00:00:00 2001 From: Igor Zubkov Date: Fri, 3 Jan 2025 11:46:15 +0100 Subject: [PATCH] Rename --- CHANGELOG.md | 1 + lib/eve_online/esi/universe_group.rb | 8 ++++---- spec/eve_online/esi/universe_group_spec.rb | 10 +++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fb0412f..4e4a0e6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * Rename `EveOnline::ESI::Models::Race#race_id` to `#id` * Rename `EveOnline::ESI::Models::Category#category_id` to `#id` * Rename `EveOnline::ESI::Models::Faction#faction_id` to `#id` +* Rename `EveOnline::ESI::Models::Group#group_id` to `#id` * Upgrade `/v5/characters/%s/notifications/` to `/v6/characters/%s/notifications/` * Upgrade `/v1/status/` to `/v2/status/` diff --git a/lib/eve_online/esi/universe_group.rb b/lib/eve_online/esi/universe_group.rb index d8fcb3ce..4037430d 100644 --- a/lib/eve_online/esi/universe_group.rb +++ b/lib/eve_online/esi/universe_group.rb @@ -9,15 +9,15 @@ class UniverseGroup < Base API_PATH = "/v1/universe/groups/%s/" - attr_reader :id + attr_reader :group_id def initialize(options = {}) super - @id = options.fetch(:id) + @group_id = options.fetch(:group_id) end - def_delegators :model, :as_json, :category_id, :group_id, :name, + def_delegators :model, :as_json, :category_id, :id, :name, :published, :type_ids def model @@ -32,7 +32,7 @@ def additional_query_params end def path - format(API_PATH, group_id: id) + format(API_PATH, group_id: group_id) end end end diff --git a/spec/eve_online/esi/universe_group_spec.rb b/spec/eve_online/esi/universe_group_spec.rb index 102fd69c..1a90aef0 100644 --- a/spec/eve_online/esi/universe_group_spec.rb +++ b/spec/eve_online/esi/universe_group_spec.rb @@ -3,7 +3,7 @@ require "spec_helper" describe EveOnline::ESI::UniverseGroup do - let(:options) { {id: 450} } + let(:options) { {group_id: 450} } subject { described_class.new(options) } @@ -20,7 +20,7 @@ its(:_write_timeout) { should eq(60) } - its(:id) { should eq(450) } + its(:group_id) { should eq(450) } end describe "#model" do @@ -72,14 +72,14 @@ specify { expect { subject.category_id }.not_to raise_error } end - describe "#group_id" do + describe "#id" do let(:model) { instance_double(EveOnline::ESI::Models::Group) } before { subject.instance_variable_set(:@model, model) } - before { expect(model).to receive(:group_id) } + before { expect(model).to receive(:id) } - specify { expect { subject.group_id }.not_to raise_error } + specify { expect { subject.id }.not_to raise_error } end describe "#name" do