Floppy-amee 0.4.20 → 0.4.21

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.
@@ -108,13 +108,13 @@ module AMEE
108
108
  raise AMEE::BadData.new("Couldn't load ProfileCategory from XML data. Check that your URL is correct.")
109
109
  end
110
110
 
111
- def self.get_history(connection, path, num_months, end_date = Date.today)
111
+ def self.get_history(connection, path, num_months, end_date = Date.today, items_per_page = 10)
112
112
  month = end_date.month
113
113
  year = end_date.year
114
114
  history = []
115
115
  num_months.times do
116
116
  date = Date.new(year, month)
117
- data = self.get(connection, path, date)
117
+ data = self.get(connection, path, date, items_per_page)
118
118
  # If we get no data items back, there is no data at all before this date, so don't bother fetching it
119
119
  if data.items.empty?
120
120
  (num_months - history.size).times do
@@ -154,8 +154,9 @@ module AMEE
154
154
  AMEE::Profile::Category.get(connection, "#{full_path}/#{child_path}")
155
155
  end
156
156
 
157
- def item(label_or_uid)
158
- item = items.find{ |x| x[:dataItemLabel] == label_or_uid || x[:dataItemUid] == label_or_uid || x[:uid] == label_or_uid}
157
+ def item(options)
158
+ # Search fields - from most specific to least specific
159
+ item = items.find{ |x| x[:uid] == options[:uid] || x[:name] == options[:name] || x[:dataItemUid] == options[:dataItemUid] || x[:dataItemLabel] == options[:dataItemLabel] }
159
160
  item ? AMEE::Profile::Item.get(connection, "#{full_path}/#{item[:path]}") : nil
160
161
  end
161
162
 
data/lib/amee/version.rb CHANGED
@@ -3,7 +3,7 @@ module AMEE
3
3
  module VERSION #:nodoc:
4
4
  MAJOR = 0
5
5
  MINOR = 4
6
- TINY = 20
6
+ TINY = 21
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
9
9
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Floppy-amee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.20
4
+ version: 0.4.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Smith
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-10 00:00:00 -08:00
12
+ date: 2008-11-17 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15