kelredd-resourceful 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,12 @@ module Resourceful
13
13
 
14
14
  def get(path, opts={})
15
15
  super(path, opts) do |path|
16
- @rest_client[path].get
16
+ result = @rest_client[path].get
17
+ if block_given?
18
+ yield result
19
+ else
20
+ result
21
+ end
17
22
  end
18
23
  end
19
24
 
@@ -28,6 +28,12 @@ module Resourceful
28
28
  end
29
29
  end
30
30
 
31
+ unless "".respond_to?(:from_currency_to_f)
32
+ def from_currency_to_f
33
+ self.gsub(/[^0-9.-]/,'').to_f
34
+ end
35
+ end
36
+
31
37
  unless "".respond_to?(:constantize)
32
38
  if Module.method(:const_get).arity == 1
33
39
  def constantize #:nodoc:
@@ -9,10 +9,12 @@ module Resourceful
9
9
  end
10
10
 
11
11
  def self.get(path, opts={})
12
- set_agent.get(path, opts)
12
+ get_proc = opts.delete(:get_proc)
13
+ set_agent.get(path, opts, &get_proc)
13
14
  end
14
15
  def self.get_collection(path, opts={})
15
- (yield set_agent.get(path, opts)).collect{|data| new(data)}
16
+ get_proc = opts.delete(:get_proc)
17
+ (yield set_agent.get(path, opts, &get_proc)).collect{|data| new(data)}
16
18
  end
17
19
 
18
20
  def initialize(data)
@@ -3,7 +3,7 @@ module Resourceful
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 4
6
- TINY = 4
6
+ TINY = 5
7
7
 
8
8
  def self.to_s # :nodoc:
9
9
  [MAJOR, MINOR, TINY].join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kelredd-resourceful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Redding