Sha256: ee386f710014bd1c6c0f3b26bca0dd86a3c71ff5bb1decdc6c6331b7b18ec69f

Contents?: true

Size: 293 Bytes

Versions: 2

Compression:

Stored size: 293 Bytes

Contents

module InvestecOpenApi
  module StringUtilities
    refine String do
      def underscore
        self.gsub(/::/, "/")
            .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
            .gsub(/([a-z\d])([A-Z])/, '\1_\2')
            .tr("-", "_")
            .downcase
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
investec_open_api-2.1.0 lib/investec_open_api/string_utilities.rb
investec_open_api-2.0.0 lib/investec_open_api/string_utilities.rb