module HardCider::Utils
Public Class Methods
underscore(string_or_symbol)
click to toggle source
@param string_or_symbol [String|Symbol] @return [Symbol]
# File lib/hard_cider/utils.rb, line 13 def self.underscore(string_or_symbol) string_or_symbol.to_s.gsub('-', '_').to_sym end
underscore_keys(hash)
click to toggle source
@param hash [Hash] @return [Hash]
# File lib/hard_cider/utils.rb, line 7 def self.underscore_keys(hash) hash.map { |k, v| [underscore(k), v] }.to_h end