Module: Rux::Utils
Instance Method Summary collapse
Instance Method Details
#attr_to_hash_elem(key, value) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/rux/utils.rb', line 3 def attr_to_hash_elem(key, value) key = key.gsub('-', '_') if key =~ /\A[\w\d]+\z/ "#{key}: #{value}" else ":\"#{key}\" => #{value}" end end |