Class: Moceansdk::Utils

Inherits:
Object
  • Object
show all
Defined in:
lib/moceansdk/utils.rb

Class Method Summary collapse

Class Method Details

.convert_to_symbol_hash(str_hash) ⇒ Object



8
9
10
11
12
# File 'lib/moceansdk/utils.rb', line 8

def self.convert_to_symbol_hash(str_hash)
  str_hash.each_with_object({}) do |(k, v), memo|
    memo[k.to_sym] = v
  end
end

.nil_or_empty?(str) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/moceansdk/utils.rb', line 4

def self.nil_or_empty?(str)
  str.nil? || str.empty?
end