Skip to content

Commit

Permalink
Remove deprecated expires_on attributes (#232)
Browse files Browse the repository at this point in the history
This commit drops the deprecated expires_on from Domain and Certificate.
This attribute was deprecated in favor of expires_at.
  • Loading branch information
duduribeiro committed Apr 20, 2021
1 parent beda5fe commit 90cca15
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 41 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This project uses [Semantic Versioning 2.0.0](http://semver.org/).
- NEW: Added `registrar.get_domain_prices` to retrieve whether a domain is premium and the prices to register, transfer, and renew. (dnsimple/dnsimple-ruby#230)
- REMOVED: `domain.reset_domain_token` endpoint no longer exists and the client method is removed.
(dnsimple/dnsimple-ruby#231)
- REMOVED: The deprecated `Domain.expires_on` is removed. (dnsimple/dnsimple-ruby#232)
- REMOVED: The deprecated `Certificate.expires_on` is removed. (dnsimple/dnsimple-ruby#232)

## 5.2.0

Expand Down
19 changes: 0 additions & 19 deletions lib/dnsimple/struct/certificate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ module Dnsimple
module Struct

class Certificate < Base

def initialize(attributes = {})
attributes.delete("expires_on")
super
@expires_on = Date.parse(expires_at).to_s if expires_at
end

# @return [Integer] The certificate ID in DNSimple.
attr_accessor :id

Expand Down Expand Up @@ -49,18 +42,6 @@ def initialize(attributes = {})

# @return [String] The timestamp when the certificate will expire.
attr_accessor :expires_at

# @deprecated Please use #expires_at instead.
# @return [String] The date when the certificate will expire.
def expires_on
warn "[DEPRECATION] Certificate#expires_on is deprecated. Please use `expires_at` instead."
@expires_on
end

def expires_on=(expiration_date)
warn "[DEPRECATION] Certificate#expires_on= is deprecated. Please use `expires_at=` instead."
@expires_on = expiration_date
end
end

end
Expand Down
20 changes: 0 additions & 20 deletions lib/dnsimple/struct/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ module Dnsimple
module Struct

class Domain < Base

def initialize(attributes = {})
attributes.delete("expires_on")
super
@expires_on = Date.parse(expires_at).to_s if expires_at
end

# @return [Integer] The domain ID in DNSimple.
attr_accessor :id

Expand Down Expand Up @@ -43,19 +36,6 @@ def initialize(attributes = {})

# @return [String] When the domain was last updated in DNSimple.
attr_accessor :updated_at

# @deprecated Please use #expires_at instead.
# @return [String] The date the domain will expire.
def expires_on
warn "[DEPRECATION] Domain#expires_on is deprecated. Please use `expires_at` instead."
@expires_on
end

def expires_on=(expiration_date)
warn "[DEPRECATION] Domain#expires_on= is deprecated. Please use `expires_at=` instead."
@expires_on = expiration_date
end

end
end
end
1 change: 0 additions & 1 deletion spec/dnsimple/client/certificates_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
expect(result.auto_renew).to be(false)
expect(result.created_at).to eq("2020-06-18T18:54:17Z")
expect(result.updated_at).to eq("2020-06-18T19:10:14Z")
expect(result.expires_on).to eq("2020-09-16")
expect(result.expires_at).to eq("2020-09-16T18:10:13Z")
end

Expand Down
1 change: 0 additions & 1 deletion spec/dnsimple/client/domains_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@
expect(result.auto_renew).to be(false)
expect(result.private_whois).to be(false)
expect(result.expires_at).to eq("2021-06-05T02:15:00Z")
expect(result.expires_on).to eq("2021-06-05")
expect(result.created_at).to eq("2020-06-04T19:15:14Z")
expect(result.updated_at).to eq("2020-06-04T19:15:21Z")
end
Expand Down

0 comments on commit 90cca15

Please sign in to comment.