DEV Community

Discussion on: Pros and Cons of Ruby's .tap Method

Collapse
 
arthurvkasper profile image
Arthur Valentim Kasper

Where did you handle with the attr name and player on this exemple?

 def new_character(name, player)
        Character.new.tap do |character|
            stats_array = ["strength", "dexterity", "intelligence", "charisma"]
            points_pool = 9
            max_roll = 6
            roll_stats(character, stats_array, points_pool, max_roll)
            save!
        end
    end
Enter fullscreen mode Exit fullscreen mode