parseitc 0.1.4 → 0.1.5

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.
@@ -3,7 +3,7 @@ require 'parseitc/transaction'
3
3
  module ParseITC
4
4
  class Parser
5
5
  attr_accessor :transactions
6
- Version = '0.1.4'
6
+ Version = '0.1.5'
7
7
  # files can be either string or array
8
8
  def initialize(files=[])
9
9
  @transactions = []
@@ -30,6 +30,7 @@ module ParseITC
30
30
  @product = array[6]
31
31
  @vendor_identifier = array[2]
32
32
  @date = Date.parse(array[11])
33
+ @product_type_id = array[8] # 1 = new, 7 = update
33
34
  @units = array[9]
34
35
  @royalty_price = array[10]
35
36
  @royalty_currency = array[15]
@@ -48,7 +49,11 @@ module ParseITC
48
49
  def price_tier
49
50
  @price_tier ||= begin
50
51
  prices = ApplePricing[@royalty_currency.downcase.to_sym]
51
- prices.find_index(@royalty_price.to_f)
52
+ if @customer_price.to_f == 0
53
+ 0
54
+ else
55
+ prices.find_index(@royalty_price.to_f)
56
+ end
52
57
  rescue
53
58
  nil
54
59
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parseitc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - HJ Choi
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-06 00:00:00 -08:00
12
+ date: 2010-03-27 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15