Sha256: 26da9280b6cc2435db4f1d90c27a4966a1d24c394c34cd4682fd86885e4ea6d1

Contents?: true

Size: 560 Bytes

Versions: 16

Compression:

Stored size: 560 Bytes

Contents

module J7W1
  module Util
    def normalize_platform(platform)
      platform = platform.to_s.downcase.to_sym unless platform.is_a? Symbol

      case platform
        when :ios, :'iphone os', :'ipad os'
          :ios
        when :android
          :android
        else
          platform
      end
    end

    def symbolize_keys_recursive(hash)
      hash.inject({}) do |h, kv|
        (key, value) = kv
        h[key.to_sym] =
            value.is_a?(Hash) ? symbolize_keys_recursive(value) : value
        h
      end
    end

    extend self
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
j7w1-0.0.27.2 lib/j7w1/util.rb
j7w1-0.0.27.1 lib/j7w1/util.rb
j7w1-0.0.27 lib/j7w1/util.rb
j7w1-0.0.26 lib/j7w1/util.rb
j7w1-0.0.25 lib/j7w1/util.rb
j7w1-0.0.24 lib/j7w1/util.rb
j7w1-0.0.23 lib/j7w1/util.rb
j7w1-0.0.22 lib/j7w1/util.rb
j7w1-0.0.21 lib/j7w1/util.rb
j7w1-0.0.20 lib/j7w1/util.rb
j7w1-0.0.19 lib/j7w1/util.rb
j7w1-0.0.18 lib/j7w1/util.rb
j7w1-0.0.17 lib/j7w1/util.rb
j7w1-0.0.16 lib/j7w1/util.rb
j7w1-0.0.15 lib/j7w1/util.rb
j7w1-0.0.14 lib/j7w1/util.rb