Floppy-amee 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/amee/profile_item.rb +10 -6
- data/lib/amee/version.rb +1 -1
- metadata +2 -2
data/lib/amee/profile_item.rb
CHANGED
@@ -235,29 +235,33 @@ module AMEE
|
|
235
235
|
end
|
236
236
|
|
237
237
|
def self.create(category, data_item_uid, options = {})
|
238
|
+
create_without_category(category.connection, category.full_path, data_item_uid, options)
|
239
|
+
end
|
240
|
+
|
241
|
+
def self.create_without_category(connection, path, data_item_uid, options = {})
|
238
242
|
# Store format if set
|
239
243
|
format = options[:format]
|
240
244
|
unless options.is_a?(Hash)
|
241
245
|
raise AMEE::ArgumentError.new("Third argument must be a hash of options!")
|
242
246
|
end
|
243
247
|
# Set dates
|
244
|
-
if options[:start_date] &&
|
248
|
+
if options[:start_date] && connection.version < 2
|
245
249
|
options[:profileDate] = options[:start_date].amee1_month
|
246
|
-
elsif options[:start_date] &&
|
250
|
+
elsif options[:start_date] && connection.version >= 2
|
247
251
|
options[:startDate] = options[:start_date].amee2schema
|
248
252
|
end
|
249
253
|
options.delete(:start_date)
|
250
|
-
if options[:end_date] &&
|
254
|
+
if options[:end_date] && connection.version >= 2
|
251
255
|
options[:endDate] = options[:end_date].amee2schema
|
252
256
|
end
|
253
257
|
options.delete(:end_date)
|
254
|
-
if options[:duration] &&
|
258
|
+
if options[:duration] && connection.version >= 2
|
255
259
|
options[:duration] = "PT#{options[:duration] * 86400}S"
|
256
260
|
end
|
257
261
|
# Send data to path
|
258
262
|
options.merge! :dataItemUid => data_item_uid
|
259
|
-
response =
|
260
|
-
category = Category.parse(
|
263
|
+
response = connection.post(path, options)
|
264
|
+
category = Category.parse(connection, response)
|
261
265
|
options.merge!(:format => format) if format
|
262
266
|
return category.item(options)
|
263
267
|
rescue
|
data/lib/amee/version.rb
CHANGED
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: 2.0.
|
4
|
+
version: 2.0.1
|
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: 2009-02-
|
12
|
+
date: 2009-02-19 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|