diff --git a/lib/pubid/nist/edition.rb b/lib/pubid/nist/edition.rb index 0229afa..cc98ec2 100644 --- a/lib/pubid/nist/edition.rb +++ b/lib/pubid/nist/edition.rb @@ -1,5 +1,5 @@ module Pubid::Nist - class Edition + class Edition < Pubid::Core::Entity attr_accessor :year, :month, :day, :parsed, :sequence def initialize(parsed: nil, year: nil, month: nil, day: nil, sequence: nil) diff --git a/lib/pubid/nist/publisher.rb b/lib/pubid/nist/publisher.rb index 77d611a..949a969 100644 --- a/lib/pubid/nist/publisher.rb +++ b/lib/pubid/nist/publisher.rb @@ -2,7 +2,7 @@ "../../../publishers.yaml")) module Pubid::Nist - class Publisher + class Publisher < Pubid::Core::Entity attr_accessor :publisher def initialize(publisher:) @@ -17,10 +17,6 @@ def to_s(format = :short) PUBLISHERS[format.to_s][@publisher] end - def ==(other) - other.publisher == @publisher - end - def self.publishers_keys PUBLISHERS["long"].keys end diff --git a/lib/pubid/nist/stage.rb b/lib/pubid/nist/stage.rb index 5da681f..4809696 100644 --- a/lib/pubid/nist/stage.rb +++ b/lib/pubid/nist/stage.rb @@ -1,7 +1,7 @@ STAGES = YAML.load_file(File.join(File.dirname(__FILE__), "../../../stages.yaml")) module Pubid::Nist - class Stage + class Stage < Pubid::Core::Entity attr_accessor :id, :type def initialize(id:, type:) diff --git a/lib/pubid/nist/update.rb b/lib/pubid/nist/update.rb index 73287d5..b30291a 100644 --- a/lib/pubid/nist/update.rb +++ b/lib/pubid/nist/update.rb @@ -1,5 +1,5 @@ module Pubid::Nist - class Update + class Update < Pubid::Core::Entity attr_accessor :number, :year, :month def initialize(number: nil, year: nil, month: nil) diff --git a/pubid-nist.gemspec b/pubid-nist.gemspec index 6762439..f690919 100644 --- a/pubid-nist.gemspec +++ b/pubid-nist.gemspec @@ -33,6 +33,6 @@ Gem::Specification.new do |spec| spec.add_dependency "thor" spec.add_dependency "lightly" spec.add_dependency "parslet" - spec.add_dependency "pubid-core", "~> 1.10.4" + spec.add_dependency "pubid-core", "~> 1.11.0" spec.add_dependency "rubyzip" end diff --git a/spec/nist_pubid/identifier_spec.rb b/spec/nist_pubid/identifier_spec.rb index e2f12bf..647c696 100644 --- a/spec/nist_pubid/identifier_spec.rb +++ b/spec/nist_pubid/identifier_spec.rb @@ -954,4 +954,15 @@ described_class.parse("NIST SP 260-162 2006ed.").weight end end + + describe "#==" do + context "when identifiers equal" do + let(:id1) { described_class.parse("NIST SP 800-66r2 IPD") } + let(:id2) { described_class.parse("NIST SP 800-66r2 IPD") } + + it "should return equal" do + expect(id1).to eq(id2) + end + end + end end