finerworks 0.1.2 → 0.1.3
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 +4 -4
- data/lib/finerworks/client.rb +34 -18
- data/lib/finerworks/order_details.rb +2 -0
- metadata +19 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9849afa0d50592f8063c79f1cecb2d7ada65886e
|
4
|
+
data.tar.gz: 5a9b49f431073e1a12104a133c7f5d3102e38559
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab771f955b0f0958a2823dc8eeb6d58a2910504c5d51ac4aeae2cc184a2b6c3c8e0294e38112679595511f477dec103eb5355d91d43d6f54747efa2a789ec521
|
7
|
+
data.tar.gz: fd6cab6d6519b57863c229cdf1c7a40c9956520f3eca2ab9e7fa0830cfdce2bf380cd236f5aad4a7855c61b8048480ebcb8032fe32f00f3af88793871c85b1aa
|
data/lib/finerworks/client.rb
CHANGED
@@ -8,6 +8,9 @@ require 'finerworks/order'
|
|
8
8
|
require 'finerworks/order_details'
|
9
9
|
|
10
10
|
module FinerWorks
|
11
|
+
# The Client is the primary interface to the FinerWorks Web API.
|
12
|
+
#
|
13
|
+
# @attr [String] account_api_key A FinerWorks account API key.
|
11
14
|
class Client
|
12
15
|
attr_accessor :account_api_key
|
13
16
|
|
@@ -19,62 +22,75 @@ module FinerWorks
|
|
19
22
|
end
|
20
23
|
|
21
24
|
# Provides account profile information.
|
25
|
+
#
|
26
|
+
# @return [Account] Account information. Returns the account associated with the client's API key.
|
22
27
|
def account
|
23
28
|
result = FinerWorks::Request.get(self, "/Account")
|
24
29
|
FinerWorks::Account.new(result.json)
|
25
30
|
end
|
26
31
|
|
27
32
|
# Updates account profile information.
|
33
|
+
#
|
34
|
+
# @param [Account] account Account information.
|
35
|
+
# @return [Response] API response.
|
28
36
|
def update_account(account)
|
29
37
|
result = FinerWorks::Request.post(self, "/Account", build_post_account_json(account))
|
30
38
|
end
|
31
39
|
|
32
40
|
# Lists prints stored in My Prints Inventory.
|
33
41
|
#
|
34
|
-
#
|
35
|
-
# ["ImageGUID"
|
36
|
-
# ["GalleryGUID"
|
42
|
+
# @param [Hash] options Filtering options.
|
43
|
+
# @option options [String] "ImageGUID" Find prints based on a specific image.
|
44
|
+
# @option options [String] "GalleryGUID" Find prints whose images are under a specific gallery.
|
45
|
+
# @return [Array<Print>] A list of prints.
|
37
46
|
def prints(options = {})
|
38
47
|
get(FinerWorks::Print, "/Prints", options)
|
39
48
|
end
|
40
49
|
|
41
50
|
# Lists galleries (aka portfolios) under the current account.
|
51
|
+
#
|
52
|
+
# @return [Array<Gallery>] A list of galleries.
|
42
53
|
def galleries
|
43
54
|
get(FinerWorks::Gallery, "/Galleries")
|
44
55
|
end
|
45
56
|
|
46
57
|
# Lists images stored in My Images.
|
47
58
|
#
|
48
|
-
#
|
49
|
-
# ["GalleryGUID"
|
50
|
-
# ["Sort"
|
51
|
-
#
|
59
|
+
# @param [Hash] options Filtering/sorting options.
|
60
|
+
# @option options [String] "GalleryGUID" Find images that are under a specific gallery.
|
61
|
+
# @option options [String] "Sort" ("DESC") Sort images by upload dates. Possible values are "ASC" or "DESC".
|
62
|
+
# @return [Array<Image>] A list of images.
|
52
63
|
def images(options = {})
|
53
64
|
get(FinerWorks::Image, "/Images", options)
|
54
65
|
end
|
55
66
|
|
56
|
-
# Lists orders
|
67
|
+
# Lists orders.
|
57
68
|
#
|
58
|
-
#
|
59
|
-
# ["OrderDateTime_Start"
|
60
|
-
# ["OrderDateTime_End"
|
61
|
-
# ["OrderStatusID"
|
62
|
-
# ["OrderID"
|
63
|
-
# ["Sort"
|
64
|
-
#
|
69
|
+
# @param [Hash] options Filtering/sorting options.
|
70
|
+
# @option options [String] "OrderDateTime_Start" Find orders in the time period starting at the specified date/time. Acceptable formats include "MM/DD/YYYY" or "YYYY-MM-DD".
|
71
|
+
# @option options [String] "OrderDateTime_End" Find orders in the time period ending at the specified date/time. Acceptable formats include "MM/DD/YYYY" or "YYYY-MM-DD".
|
72
|
+
# @option options [String] "OrderStatusID" Find orders with a specific status.
|
73
|
+
# @option options [String] "OrderID" Find a specific order by order ID.
|
74
|
+
# @option options [String] "Sort" ("DESC") Sort orders by ID. Possible values are "ASC" or "DESC".
|
75
|
+
# @return [Array<Order>] A list of orders.
|
65
76
|
def orders(options = {})
|
66
77
|
get(FinerWorks::Order, "/Orders", options)
|
67
78
|
end
|
68
79
|
|
69
|
-
# Provides order
|
80
|
+
# Provides details for a specific order.
|
70
81
|
#
|
71
|
-
#
|
72
|
-
# [
|
82
|
+
# @param id [Integer] Order ID number.
|
83
|
+
# @return [Array<OrderDetails>] Order details for the given order ID.
|
73
84
|
def order_details(id)
|
74
85
|
get(FinerWorks::OrderDetails, "/OrderDetails", { "OrderID" => id })
|
75
86
|
end
|
76
87
|
|
77
88
|
# Generic GET method to request items of the specified +type+. This always returns an +Array+.
|
89
|
+
#
|
90
|
+
# @param type [Class] Type of objects to return.
|
91
|
+
# @param path [String] API request path.
|
92
|
+
# @param [Hash] options Parameters to include in the request URI.
|
93
|
+
# @return [Array<Object>] A list of items.
|
78
94
|
def get(type, path, options = {})
|
79
95
|
response = FinerWorks::Request.get(self, path, options)
|
80
96
|
items = response.json.kind_of?(Array) ? response.json : [response.json]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: finerworks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Fredrickson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '10.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.10'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.10'
|
83
97
|
description: This gem wraps the FinerWorks Web API in order to provide an easy way
|
84
98
|
to utilize the API in Ruby apps.
|
85
99
|
email:
|
@@ -108,9 +122,9 @@ require_paths:
|
|
108
122
|
- lib
|
109
123
|
required_ruby_version: !ruby/object:Gem::Requirement
|
110
124
|
requirements:
|
111
|
-
- - "
|
125
|
+
- - ">="
|
112
126
|
- !ruby/object:Gem::Version
|
113
|
-
version:
|
127
|
+
version: 1.9.3
|
114
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
129
|
requirements:
|
116
130
|
- - ">="
|
@@ -123,3 +137,4 @@ signing_key:
|
|
123
137
|
specification_version: 4
|
124
138
|
summary: Ruby interface for the FinerWorks Web API
|
125
139
|
test_files: []
|
140
|
+
has_rdoc:
|