active_object 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6b50729a90bddc311c59585834a86ad2c19a5d48
4
- data.tar.gz: a947a8d5b05ab1a8c993ee0800c8772f2a01620e
3
+ metadata.gz: c37d1b84c04412c27d1b8095b13e792d274c241f
4
+ data.tar.gz: c0af04da07d27d2563a57397636af1cb9dde3199
5
5
  SHA512:
6
- metadata.gz: 1a242ede6bd2219518280ae420a06546a4022497c79acb743849a23b815f1ea18e110625ffb41bd83d86cdca2d3ac886bd57ba03f8bc7348cb4221a3f128bf10
7
- data.tar.gz: ab51dac6fa2df809586a0121f5858134bed826f1d398615629b815aff14261876844506a5578570b6150a642c15f5492999c57cf4eedfb09f649bdcbcd564b52
6
+ metadata.gz: e0907a1844303d9f7671bffe5c9dbe7560147bdbfb2f52a15adf58610a284802de9de369155759c008447efe3a406a8ce939485b2fae70e130e02f8d7990f778
7
+ data.tar.gz: b80a219326e6fb02784ceb0e1a4b9a5c087772fc010c59c2431d9abd0ef62638fe11bc64598be9ff6a304b5dd5e918d7b7ff0d985dc3b6cab4376a7e710bd629
data/README.md CHANGED
@@ -33,14 +33,14 @@ Or install it yourself as:
33
33
  ### Array
34
34
 
35
35
  ####Delete First:####
36
- `delete_first` removes the first element from an array. Like Array.shift, but returns the array instead of the removed element.
36
+ `delete_first` and `delete_first!` removes the first element from an array. Like Array.shift, but returns the array instead of the removed element.
37
37
 
38
38
  ```ruby
39
39
  ["1", "2", "3"].delete_first #=> ["2", "3"]
40
40
  ```
41
41
 
42
42
  ####Delete Last:####
43
- `delete_last` removes the last element from an array. Like Array.pop, but returns the array instead of the removed element.
43
+ `delete_last` and `delete_last!` removes the last element from an array. Like Array.pop, but returns the array instead of the removed element.
44
44
 
45
45
  ```ruby
46
46
  ["1", "2", "3"].delete_last #=> ["1", "2"]
@@ -89,7 +89,7 @@ Or install it yourself as:
89
89
  ```
90
90
 
91
91
  ####Strip:####
92
- `strip` removes blank elements from an array.
92
+ `strip` and `strip!` removes blank elements from an array.
93
93
 
94
94
  ```ruby
95
95
  ["this", "", "that", nil, false].strip #=> ["this", "that"]
@@ -970,8 +970,8 @@ h.slice!(:a, :b) #=> { c: 3, d: 4 }
970
970
  `present?` determines if an object is not empty or nil. `Rails Safe`
971
971
 
972
972
  ```ruby
973
- "Awesome Sting".blank? #=> true
974
- "".present? #=> false
973
+ "Awesome Sting".present? #=> true
974
+ "".present? #=> false
975
975
  ```
976
976
 
977
977
  ####Try:####
@@ -4,10 +4,18 @@ class Array
4
4
  self[1..-1]
5
5
  end
6
6
 
7
+ def delete_first!
8
+ replace(delete_first)
9
+ end
10
+
7
11
  def delete_last
8
12
  self[0...-1]
9
13
  end
10
14
 
15
+ def delete_last!
16
+ replace(delete_last)
17
+ end
18
+
11
19
  unless defined?(Rails)
12
20
  def from(position)
13
21
  self[position, size] || []
@@ -85,6 +93,10 @@ class Array
85
93
  reject { |v| v.blank? }
86
94
  end
87
95
 
96
+ def strip!
97
+ replace(strip)
98
+ end
99
+
88
100
  unless defined?(Rails)
89
101
  def to(position)
90
102
  position >= 0 ? first(position + 1) : self[0..position]
@@ -1,3 +1,3 @@
1
1
  module ActiveObject
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_object
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez