boxr 1.5.0 → 1.5.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
  SHA256:
3
- metadata.gz: 8f0d102a912384569f1918652ed8c2a0826fa82ebc9aed2178f34345fa9e3699
4
- data.tar.gz: b9fb53a155bb2df57c91c46d8ec02055417c6f9a28ecbd28bacf855edac84c15
3
+ metadata.gz: 7f849171875f3edd0a0b62558c2c7d78fa9b06fae858d09ea4f031b943a3da80
4
+ data.tar.gz: 5ea0d5bee9dffe5b897e8c917d6ee926759957fa342563d8f771a96f7f4b2a40
5
5
  SHA512:
6
- metadata.gz: d55466cf1c6571ed22ac9c708b50dca5f7932c28095e19239f791d101dad3c8a42adb6ca20f97e4815bf11ac226eecb461d5d18d1f2cc742a7f69e878fa1f705
7
- data.tar.gz: 73b64881401047d64bcb8473a2dfd5b7bf17f12aa2b1d5ec089314fca3421e28da01f3e8ada2e729cdca7e62e3fba216031bcd2119fe0405848e8d66880ae100
6
+ metadata.gz: bde5b109120de0b88606ff059082388e8aa32ae6c0bec6c237d689a1b65887d0ad734d9531e64f1db72b45ff2171f69a2e31f17c6903e1e6bf236338158e84f2
7
+ data.tar.gz: 0675dfa9b0743557a4d113fd7c6d8282d2ca83650f541377e5723f5b5d8243d666f8c3b896207a9f3cbc889e155d80c398672677f3bb5eb6302275b85329af0e
data/lib/boxr.rb CHANGED
@@ -24,17 +24,24 @@ require 'boxr/auth'
24
24
  require 'boxr/web_links'
25
25
  require 'boxr/watermarking'
26
26
 
27
- module Enumerable
27
+ class BoxrCollection < Array
28
28
  def files
29
- self.select{|i| i.type == 'file'}
29
+ collection_for_type('file')
30
30
  end
31
31
 
32
32
  def folders
33
- self.select{|i| i.type == 'folder'}
33
+ collection_for_type('folder')
34
34
  end
35
35
 
36
36
  def web_links
37
- self.select{|i| i.type == 'web_link'}
37
+ collection_for_type('web_link')
38
+ end
39
+
40
+ private
41
+
42
+ def collection_for_type(type)
43
+ items = select { |i| i.type == type }
44
+ BoxrCollection.new(items)
38
45
  end
39
46
  end
40
47
 
data/lib/boxr/client.rb CHANGED
@@ -133,7 +133,7 @@ module Boxr
133
133
  end
134
134
  end until offset - total_count >= 0
135
135
 
136
- entries.flatten.map{|i| BoxrMash.new(i)}
136
+ BoxrCollection.new(entries.flatten.map{ |i| BoxrMash.new(i) })
137
137
  end
138
138
 
139
139
  def post(uri, body, query: nil, success_codes: [201], process_body: true, content_md5: nil, content_type: nil, if_match: nil)
data/lib/boxr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Boxr
2
- VERSION = "1.5.0"
2
+ VERSION = "1.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boxr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chad Burnette