Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase file level typedness at least typed: true #183

Merged
merged 4 commits into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/vonage/abstract_authentication.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: ignore
# typed: true

module Vonage
class AbstractAuthentication
Expand Down
2 changes: 1 addition & 1 deletion lib/vonage/applications/list_response.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: ignore
# typed: true

class Vonage::Applications::ListResponse < Vonage::Response
include Enumerable
Expand Down
2 changes: 1 addition & 1 deletion lib/vonage/basic.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: ignore
# typed: true

module Vonage
class Basic < AbstractAuthentication
Expand Down
2 changes: 1 addition & 1 deletion lib/vonage/bearer_token.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: ignore
# typed: true
# frozen_string_literal: true

module Vonage
Expand Down
2 changes: 1 addition & 1 deletion lib/vonage/form_data.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: ignore
# typed: true

module Vonage
module FormData
Expand Down
2 changes: 1 addition & 1 deletion lib/vonage/jwt.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: false
# typed: true
# frozen_string_literal: true
require 'securerandom'
require 'openssl'
Expand Down
6 changes: 3 additions & 3 deletions lib/vonage/namespace.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: ignore
# typed: true
# frozen_string_literal: true
require 'net/http'
require 'json'
Expand Down Expand Up @@ -61,7 +61,7 @@ def request(path, params: nil, type: Get, response_class: Response, &block)
authentication = self.class.authentication.new(@config)
authentication.update(params)

unless type::REQUEST_HAS_BODY || params.empty?
unless type.const_get(:REQUEST_HAS_BODY) || params.empty?
uri.query = Params.encode(params)
end

Expand All @@ -77,7 +77,7 @@ def request(path, params: nil, type: Get, response_class: Response, &block)

authentication.update(message)

self.class.request_body.update(message, params) if type::REQUEST_HAS_BODY
self.class.request_body.update(message, params) if type.const_get(:REQUEST_HAS_BODY)

logger.log_request_info(message)

Expand Down
2 changes: 1 addition & 1 deletion lib/vonage/numbers/list_response.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: ignore
# typed: true

class Vonage::Numbers::ListResponse < Vonage::Response
include Enumerable
Expand Down
4 changes: 2 additions & 2 deletions lib/vonage/numbers/response.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# typed: false
# typed: true
# frozen_string_literal: true

class Vonage::Numbers::Response < Vonage::Response
def success?
error_code == '200'
T.unsafe(self).error_code == '200'
end
end
2 changes: 1 addition & 1 deletion lib/vonage/params.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: ignore
# typed: true
# frozen_string_literal: true
require 'cgi'

Expand Down
2 changes: 1 addition & 1 deletion lib/vonage/secrets/list_response.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: ignore
# typed: true

class Vonage::Secrets::ListResponse < Vonage::Response
include Enumerable
Expand Down
2 changes: 1 addition & 1 deletion lib/vonage/voice/list_response.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typed: ignore
# typed: true

class Vonage::Voice::ListResponse < Vonage::Response
include Enumerable
Expand Down