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

Add sorbet types to some modules #180

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/vonage/gsm7.rb
@@ -1,11 +1,13 @@
# typed: ignore
# typed: strong

module Vonage
module GSM7
extend T::Sig
ohbarye marked this conversation as resolved.
Show resolved Hide resolved
CHARACTERS = "\n\f\r !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_abcdefghijklmnopqrstuvwxyz{|}~ ¡£¤¥§¿ÄÅÆÉÑÖØÜßàäåæçèéìñòöøùüΓΔΘΛΞΠΣΦΨΩ€"

REGEXP = /\A[#{Regexp.escape(CHARACTERS)}]*\z/

sig {params(string: T.nilable(String)).returns(T.nilable(Integer))}
ohbarye marked this conversation as resolved.
Show resolved Hide resolved
def self.encoded?(string)
REGEXP =~ string
end
Expand Down
5 changes: 4 additions & 1 deletion lib/vonage/user_agent.rb
@@ -1,8 +1,11 @@
# typed: ignore
# typed: strong
# frozen_string_literal: true

module Vonage
module UserAgent
extend T::Sig

sig { params(app_name: T.nilable(String), app_version: T.nilable(String)).returns(String) }
def self.string(app_name, app_version)
identifiers = []
identifiers << 'vonage-ruby/' + VERSION
Expand Down