active_object 5.6.0 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/lib/active_object/string.rb +10 -0
- data/lib/active_object/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b093e29d0378623498441f8037c523eb3e67f558bb83e9964c57bf5625db6def
|
4
|
+
data.tar.gz: 8107c37f3ea2508749dbb370d72a11bacc1123f2ac404970633eb85211e455b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51356f34a64e12f619b233280a804bd01b28a7470ef735f5ecb2d22c95ea104d1a85dab1ff203f514e4aab16af2f2d6c0773f00bf8a32f8817b64b8d9e56a1f5
|
7
|
+
data.tar.gz: ba913963613f3a6b7cd60b9f1286ff87ae44de19b88ed76782dd4d39e6c4fb2eab8b36a3595afd3b04b470bf46f637efdb6b4909e40fb1fd9f579a999480b4a8
|
data/README.md
CHANGED
@@ -1802,6 +1802,13 @@ false.truthy? #=> false
|
|
1802
1802
|
'example'.from(3) #=> 'mple'
|
1803
1803
|
```
|
1804
1804
|
|
1805
|
+
**Headerize:**
|
1806
|
+
`headerize` and `headerize!` capitalizes each word.
|
1807
|
+
|
1808
|
+
```ruby
|
1809
|
+
' example test-sample '.headerize #=> 'Example Test-sample'
|
1810
|
+
```
|
1811
|
+
|
1805
1812
|
**Humanize:**
|
1806
1813
|
`humanize` and `humanize!` transforms a string to a human readable string.
|
1807
1814
|
|
data/lib/active_object/string.rb
CHANGED
@@ -105,6 +105,16 @@ module ActiveObject
|
|
105
105
|
self[position..-1]
|
106
106
|
end
|
107
107
|
|
108
|
+
def headerize
|
109
|
+
squish.split(' ')
|
110
|
+
.map(&:capitalize)
|
111
|
+
.join(' ')
|
112
|
+
end
|
113
|
+
|
114
|
+
def headerize!
|
115
|
+
replace(headerize)
|
116
|
+
end
|
117
|
+
|
108
118
|
def humanize(options = {})
|
109
119
|
capitalize = options[:capitalize] || true
|
110
120
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
170
|
version: '0'
|
171
171
|
requirements: []
|
172
172
|
rubyforge_project:
|
173
|
-
rubygems_version: 2.7.
|
173
|
+
rubygems_version: 2.7.8
|
174
174
|
signing_key:
|
175
175
|
specification_version: 4
|
176
176
|
summary: Gem for commonly used ruby object helpers.
|