Active Supportͱʁ
• Active SupportRuby on RailsͷίϯϙʔωϯτͰ
͋ΓɺRubyݴޠͷ֦ுɺϢʔςΟϦςΟɺͦͷଞԣ
அతͳ࡞ۀΛ୲͍ͬͯ·͢ɻ
• Active SupportݴޠϨϕϧͰجຊ෦Λఈ্͛͠
ͯ๛͔ͳͷʹ͠ɺRailsΞϓϦέʔγϣϯͷ։ൃͱ
Ruby on RailsͦΕࣗମͷ։ൃʹཱͯΔ͘࡞ΒΕ
͍ͯ·͢ɻ
Ҿ༻: http://railsguides.jp/active_support_core_extensions.html
Object
content = ‘The Jedi are a fictional and ancient
monastic, spiritual, and academic meritocratic
organization and the main protagonists in the fictional
Star Wars universe, whose origins dates back to circa
25,000 BBY (Before Battle of Yavin; the destruction of
the first Death Star).’
content.try { upcase.truncate } # => “THE JED...”
Array
%w( a b c d e ).second # => “b”
%w( a b c d e ).third # => “c”
%w( a b c d e ).fourth # => “d”
%w( a b c d e ).fifth # => “e”
(1..42).to_a.forty_two # => 42
Slide 17
Slide 17 text
Array
[‘apple’, ‘milk’, ‘orange’].to_sentense
# => “apple, milk, and orange”