Class: Miasma::Contrib::AzureApiCore::Signature
- Inherits:
-
Object
- Object
- Miasma::Contrib::AzureApiCore::Signature
- Defined in:
- lib/miasma/contrib/azure.rb
Overview
Base signature class
Direct Known Subclasses
Instance Method Summary collapse
-
#generate(http_method, path, opts = {}) ⇒ String
Generate the signature.
-
#initialize(*args) ⇒ Signature
constructor
Create new instance.
-
#safe_escape(string) ⇒ String
URL string escape.
Constructor Details
#initialize(*args) ⇒ Signature
Create new instance
82 83 84 |
# File 'lib/miasma/contrib/azure.rb', line 82 def initialize(*args) raise NotImplementedError.new 'This class should not be used directly!' end |
Instance Method Details
#generate(http_method, path, opts = {}) ⇒ String
Generate the signature
92 93 94 |
# File 'lib/miasma/contrib/azure.rb', line 92 def generate(http_method, path, opts={}) raise NotImplementedError end |
#safe_escape(string) ⇒ String
URL string escape
100 101 102 103 104 |
# File 'lib/miasma/contrib/azure.rb', line 100 def safe_escape(string) string.to_s.gsub(/([^a-zA-Z0-9_.\-~])/) do '%' << $1.unpack('H2' * $1.bytesize).join('%').upcase end end |