Save a value in the yml file and use it on Login with Ruby. Please

I'll try to explain, I have my yml file in my automation DADOS = YAML.load(File.open(File.join(File.dirname(FILE) + "/massa/users.yml")))

cad_user:
  :_password: 357226
  :_company: SQATest
  :_address: International Drive 678
  :_city: Bradenton
  :_state: Florida
  :_post_cod: 34201
  :user:      Robert Platt

I want to write to :user a value of a field that receives a gemfaker If I do it this way, informing a string OK, but when I pass the object's value equal to example 2, it records many things less the value that is generated in the field:

def save_user
    d = YAML::load_file('C:/temp/P4F/front/features/support/massa/users.yml') #Load
    d[:cad_user][:user] = 'user' #Modify
    File.open('C:/temp/P4F/front/features/support/massa/users.yml', 'w') {|f| f.write d.to_yaml } #Store
  end

Example 2

def save_user
    d = YAML::load_file('C:/temp/P4F/front/features/support/massa/users.yml') #Load
    d[:cad_user][:user] = input_email_create.send_keys(Faker::Internet.email)   #Modify
    File.open('C:/temp/P4F/front/features/support/massa/users.yml', 'w') {|f| f.write d.to_yaml } #Store
  end
  end
How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum