Sha256: 5f5cd0293e87410b8ad51b32de5c4ffee9a3b611313f76f7f040e4ef36178d9a

Contents?: true

Size: 583 Bytes

Versions: 5

Compression:

Stored size: 583 Bytes

Contents

module Vacuum
  module Request
    module Utils
      # Camelizes a value.
      #
      # val - A String value.
      #
      # Returns an upper-camelcased String.
      def self.camelize(val)
        val.split('_').map(&:capitalize).join
      end

      # Percent encodes a URI component.
      #
      # component - The String URI component to encode.
      #
      # Returns the String encoded component.
      def self.encode(component)
        Addressable::URI.encode_component \
          component, Addressable::URI::CharacterClasses::UNRESERVED
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vacuum-0.2.2 lib/vacuum/request/utils.rb
vacuum-0.2.1 lib/vacuum/request/utils.rb
vacuum-0.2.0 lib/vacuum/request/utils.rb
vacuum-0.2.0.pre.1 lib/vacuum/request/utils.rb
vacuum-0.2.0.pre lib/vacuum/request/utils.rb