-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
48 lines (26 loc) · 753 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
RubyExtensions
==============
Simple Rails plugin providing various extensions to base Ruby classes.
Installation
============
git submodule add git://github.com/pjg/ruby_extensions.git vendor/plugins/ruby_extensions
git commit -m "Add ruby_extensions plugin as a submodule"
Examples
========
Array.arithmetic_mean
>> [1, 2, 3, 4, 5].arithmetic_mean
=> 3.0
Array.geometric_mean
>> [2, 3, 4.5].geometric_mean
=> 3.0
String.to_slug
>> "Iñtërnâtiônàlizætiøn".to_slug
=> "internationalizaetion"
>> "中文測試".to_slug
=> "zhong-wen-ce-shi"
Time.to_s extensions
>> Time.now.to_s(:detailed)
=> "2009-01-02 12:20"
>> Time.now.to_s(:brief)
=> "2010-02-06"
Copyright (c) 2008-2010 Paweł Gościcki, released under the MIT license