obj.fio = data_after["fio"]
obj.phone = data_after["phone"]
obj.email = data_after["email"]
obj.address= data_after["address"]
obj.skype = data_after["skype"]
...
class MyClass
attr_accessor :name, :surname, :email
end
obj = MyClass.new
hash = {name: 'Ivan', surname: 'Ivanov', email: 'ivan@ivanov.com'}
hash.each do |key, value|
obj.public_send(%Q{#{key}=}, value) if obj.respond_to?(%Q{#{key}=})
end
p obj # => #<MyClass:0x007f9a4c11c478 @name="Ivan", @surname="Ivanov", @email="ivan@ivanov.com">