#homesteading book draft 2:
* wrote 3,000 words (12 pages)
* revised 14,000 words (48 pages)
* book is now > 500,000 words (1,667 pages)
* on schedule for completion on 28 Feb
have "Monday" in there twice. So, back to the mini function. The syntax { |k, v| ... } says "define a mini function which takes two arguments on each invocation; first one is the key, second one is the value" so http://sections.select { | k, v| <minifunc> } ...
-
-
* passes in k = Monday, v = 12 * evaluates the minifunc * gets either boolean true or false as a result * based on that, chooses or does not choose the pair k/v to put in the output bad_sections = http://sections.select { |k, v| k.count(":") + 1 != v } sets bad_sections
-
to have only those items from the original variable sections that have an improper count(":")
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.