blomming_api 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/bin/blomming_api +40 -0
- data/blomming_api.gemspec +40 -0
- data/lib/blomming_api/buy_endpoints.rb +355 -0
- data/lib/blomming_api/config.rb +76 -0
- data/lib/blomming_api/help.rb +140 -0
- data/lib/blomming_api/oauth_endpoint.rb +83 -0
- data/lib/blomming_api/private_helpers.rb +78 -0
- data/lib/blomming_api/public_helpers.rb +93 -0
- data/lib/blomming_api/sell_endpoints.rb +300 -0
- data/lib/blomming_api/version.rb +3 -0
- data/lib/blomming_api.rb +54 -0
- metadata +147 -0
data/lib/blomming_api.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'yaml'
|
3
|
+
require 'multi_json'
|
4
|
+
require 'rest_client' # https://github.com/rest-client/rest-client
|
5
|
+
|
6
|
+
require 'blomming_api/version'
|
7
|
+
require 'blomming_api/help'
|
8
|
+
|
9
|
+
# modules
|
10
|
+
require 'blomming_api/config'
|
11
|
+
require 'blomming_api/private_helpers'
|
12
|
+
require 'blomming_api/oauth_endpoint'
|
13
|
+
require 'blomming_api/buy_endpoints'
|
14
|
+
require 'blomming_api/sell_endpoints'
|
15
|
+
require 'blomming_api/public_helpers'
|
16
|
+
|
17
|
+
module BlommingApi
|
18
|
+
|
19
|
+
#
|
20
|
+
# CLIENT ACCESS LOGIC
|
21
|
+
#
|
22
|
+
class Client
|
23
|
+
|
24
|
+
private
|
25
|
+
include Config
|
26
|
+
include PrivateHelpers
|
27
|
+
|
28
|
+
public
|
29
|
+
include OauthEndpoint
|
30
|
+
include BuyEndpoints
|
31
|
+
include SellEndpoints
|
32
|
+
include PublicHelpers
|
33
|
+
|
34
|
+
# instance variables, read-only
|
35
|
+
attr_reader :description
|
36
|
+
attr_reader :services, :grant_type
|
37
|
+
attr_reader :client_id, :client_secret, :username, :password
|
38
|
+
attr_reader :domain, :api_version
|
39
|
+
attr_reader :token_type, :expires_in, :refresh_token, :access_token
|
40
|
+
|
41
|
+
# instance variables, read/write
|
42
|
+
attr_accessor :currency, :locale, :verbose
|
43
|
+
|
44
|
+
# new
|
45
|
+
def initialize(config_filename)
|
46
|
+
# read YAML configuration file
|
47
|
+
read_config_file config_filename
|
48
|
+
|
49
|
+
# authenticate client when a new client is created
|
50
|
+
authenticate :initialize
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
metadata
ADDED
@@ -0,0 +1,147 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: blomming_api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Giorgio Robino
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-01-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: method_source
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rest-client
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: multi_json
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: oj
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.3'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.3'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: 'www.blomming.com social commerce API''s wrapper: supply a client access
|
98
|
+
layer that embed authentication and communication details, supply API endpoints
|
99
|
+
wrappers.'
|
100
|
+
email:
|
101
|
+
- giorgio.robino@gmail.com
|
102
|
+
executables:
|
103
|
+
- blomming_api
|
104
|
+
extensions: []
|
105
|
+
extra_rdoc_files: []
|
106
|
+
files:
|
107
|
+
- .gitignore
|
108
|
+
- Gemfile
|
109
|
+
- LICENSE.txt
|
110
|
+
- README.md
|
111
|
+
- Rakefile
|
112
|
+
- bin/blomming_api
|
113
|
+
- blomming_api.gemspec
|
114
|
+
- lib/blomming_api.rb
|
115
|
+
- lib/blomming_api/buy_endpoints.rb
|
116
|
+
- lib/blomming_api/config.rb
|
117
|
+
- lib/blomming_api/help.rb
|
118
|
+
- lib/blomming_api/oauth_endpoint.rb
|
119
|
+
- lib/blomming_api/private_helpers.rb
|
120
|
+
- lib/blomming_api/public_helpers.rb
|
121
|
+
- lib/blomming_api/sell_endpoints.rb
|
122
|
+
- lib/blomming_api/version.rb
|
123
|
+
homepage: https://github.com/solyaris/blomming_api
|
124
|
+
licenses:
|
125
|
+
- MIT
|
126
|
+
metadata: {}
|
127
|
+
post_install_message:
|
128
|
+
rdoc_options: []
|
129
|
+
require_paths:
|
130
|
+
- lib
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - '>='
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: 1.9.0
|
136
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - '>='
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
requirements: []
|
142
|
+
rubyforge_project:
|
143
|
+
rubygems_version: 2.1.11
|
144
|
+
signing_key:
|
145
|
+
specification_version: 4
|
146
|
+
summary: www.blomming.com social commerce API's wrapper
|
147
|
+
test_files: []
|