Skip to content

Commit 0954ba3

Browse files
authored
Merge pull request #95 from fastruby/IIRR-34-seeds
IIRR-34: Add seed puzzles reproducing codeblock newline rendering
2 parents c80f306 + 15eaeb5 commit 0954ba3

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

db/seeds.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@
9090
question: "Ruby or Rails provided this method?\n\n```\nclass SomeClass\n def method\n whatever\n end\nend\n```",
9191
answer: :rails,
9292
explanation: "Not really important, just to show it renders blocks"
93+
},
94+
{
95+
question: "In this snippet:\n```\nprices = { apple: 1, banana: 2, cherry: 3 }\ndiscounted = prices.transform_values { |price| price * 0.9 }\n\ndiscounted\n=> {:apple=>0.9, :banana=>1.8, :cherry=>2.7}\n```\nIs the `transform_values` method a Ruby or Rails method?",
96+
answer: :ruby,
97+
explanation: "`Hash#transform_values` has been part of core Ruby since 2.4.0. It originated as an ActiveSupport addition, then was promoted into Ruby core."
98+
},
99+
{
100+
question: "In this snippet:\n```\nusername = \" \"\nusername.blank?\n\n=> true\n```\nIs the `blank?` method a Ruby or Rails method?",
101+
answer: :rails,
102+
explanation: "`blank?` is an ActiveSupport (Rails) method added to every object. Plain Ruby has no `blank?`; ActiveSupport makes a whitespace-only String return true."
93103
}
94104
]
95105

0 commit comments

Comments
 (0)