module DTK::Client::Auxiliary
Public Instance Methods
hash_to_yaml(hash_content)
click to toggle source
# File lib/client/util/auxiliary.rb, line 30 def hash_to_yaml(hash_content) YAML.dump(hash_content) end
snake_form(command_class, seperator='_')
click to toggle source
# File lib/client/util/auxiliary.rb, line 26 def snake_form(command_class, seperator='_') command_class.to_s.gsub(/^.*::/, '').gsub(/Command$/,'').scan(/[A-Z][a-z]+/).map{|w|w.downcase}.join(seperator) end
snake_to_camel_case(snake_form)
click to toggle source
# File lib/client/util/auxiliary.rb, line 22 def snake_to_camel_case(snake_form) snake_form.to_s.gsub('-','_').to_s.split('_').map{|t|t.capitalize}.join('') end
yaml_to_hash(yaml_content)
click to toggle source
# File lib/client/util/auxiliary.rb, line 34 def yaml_to_hash(yaml_content) YAML.load(yaml_content) end