Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
biow0lf committed Jan 3, 2025
1 parent 2c34656 commit 958be77
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/%<character_id>s/notifications/` to `/v6/characters/%<character_id>s/notifications/`
* Upgrade `/v1/status/` to `/v2/status/`

Expand Down
8 changes: 4 additions & 4 deletions lib/eve_online/esi/universe_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ class UniverseGroup < Base

API_PATH = "/v1/universe/groups/%<group_id>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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions spec/eve_online/esi/universe_group_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 958be77

Please sign in to comment.