Module: GraphQL::Schema::Base64Encoder Private
- Defined in:
- lib/graphql/schema/base_64_encoder.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
- .decode(encoded_text, nonce: false) ⇒ Object private
- .encode(unencoded_text, nonce: false) ⇒ Object private
Class Method Details
.decode(encoded_text, nonce: false) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 14 15 16 |
# File 'lib/graphql/schema/base_64_encoder.rb', line 11 def self.decode(encoded_text, nonce: false) # urlsafe_decode64 is for forward compatibility Base64.urlsafe_decode64(encoded_text) rescue ArgumentError raise GraphQL::ExecutionError, "Invalid input: #{encoded_text.inspect}" end |
.encode(unencoded_text, nonce: false) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
7 8 9 |
# File 'lib/graphql/schema/base_64_encoder.rb', line 7 def self.encode(unencoded_text, nonce: false) Base64.urlsafe_encode64(unencoded_text, padding: false) end |