Module: HardCider::Utils
- Defined in:
- lib/hard_cider/utils.rb
Class Method Summary collapse
Class Method Details
.underscore(string_or_symbol) ⇒ Symbol
13 14 15 |
# 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) ⇒ Hash
7 8 9 |
# File 'lib/hard_cider/utils.rb', line 7 def self.underscore_keys(hash) hash.map { |k, v| [underscore(k), v] }.to_h end |