finapps 0.7.0.pre → 0.7.1.pre

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43601a6677c141e8c942a87ce42ca729df9ac52b
4
- data.tar.gz: 78e99369b8ba1c1830cf1efd34e68acc4b273ccf
3
+ metadata.gz: 5bcb8bbdce504f491562723f44969165d65085a1
4
+ data.tar.gz: 5c3f47bd0c0f36c2674fb1a8b5130b3ce511d302
5
5
  SHA512:
6
- metadata.gz: f574ea80b9c9dfb9034fe4bdc943d3cad70134678c6505ca4906556a2bbf2871ced97d583acbdea31c29d2e8b84eadea8be53184d226449638bfdcaf8b50d3ed
7
- data.tar.gz: b34f7760681b2f0da0ba5dfd03d8b4102051b0f60ce4b514d8a34814ab365acf89048a701d5ddff109a167952bd617cc90426ef7da6013852b581eb351d75261
6
+ metadata.gz: 3924521b771e0505f758101d8c0e80032c6ec023dc6d144bcdced3abcf210bc640c4131b60c5673151d26d2740158bc5587aa4d43a99d6369eb06a9e91ecc226
7
+ data.tar.gz: 34d0c64901b1164240ecab9ff931b2e15b6d6b16634cae933971df2774e491e571ddc9ae06296a4eb391c87e93870b40889d45697b736193bbb0c0cdf13a13be
@@ -4,8 +4,37 @@ module FinApps
4
4
  class Transactions < FinApps::REST::Resources
5
5
  include FinApps::REST::Defaults
6
6
 
7
+ # @transaction_id [String]
8
+ # # @return [Hash, Array<String>]
9
+ def search_by_id(transaction_id)
10
+ logger.debug "##{__method__.to_s} => Started"
11
+
12
+ transactions, error_messages = search_by_ids([transaction_id])
13
+
14
+ # get one
15
+ transaction = transactions.present? ? transactions.first : nil
16
+
17
+ logger.debug "##{__method__.to_s} => Completed"
18
+ return transaction, error_messages
19
+ end
20
+
21
+ # @transaction_ids [Array<String>]
22
+ # # @return [Array<Hash>, Array<String>]
23
+ def search_by_ids(transaction_ids)
24
+ logger.debug "##{__method__.to_s} => Started"
25
+
26
+ transactions, error_messages = search
27
+
28
+ # filter by given ids
29
+ transactions = transactions.present? ? transactions.select { |t| transaction_ids.include?(t[:_id]) } : nil
30
+
31
+ logger.debug "##{__method__.to_s} => Completed"
32
+ return transactions, error_messages
33
+ end
34
+
35
+
7
36
  # @param [Hash] params
8
- # @return [Array<FinApps::REST::Transaction>, Array<String>]
37
+ # @return [Array<Hash>, Array<String>]
9
38
  def search(params={})
10
39
  logger.debug "##{__method__.to_s} => Started"
11
40
 
@@ -20,6 +49,7 @@ module FinApps
20
49
  end
21
50
 
22
51
  # @param [Hash] params
52
+ # @return [Array<Hash>, Array<String>]
23
53
  def edit(params={})
24
54
  logger.debug "##{__method__.to_s} => Started"
25
55
 
@@ -1,3 +1,3 @@
1
1
  module FinApps
2
- VERSION = '0.7.0.pre'
2
+ VERSION = '0.7.1.pre'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finapps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0.pre
4
+ version: 0.7.1.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-26 00:00:00.000000000 Z
11
+ date: 2014-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor