centaman 0.1.0

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.
@@ -0,0 +1,3 @@
1
+ module Centaman
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,45 @@
1
+ module Centaman
2
+ #:nodoc:
3
+ class Wrapper
4
+ include HTTParty
5
+
6
+ if ENV['FIXIE_URL']
7
+ FIXIE = URI.parse(ENV['FIXIE_URL'])
8
+ http_proxy FIXIE.host, FIXIE.port, FIXIE.user, FIXIE.password
9
+ end
10
+
11
+ attr_reader :api_username, :api_password
12
+
13
+ def initialize(args = {})
14
+ @api_username = ENV['API_USERNAME']
15
+ @api_password = ENV['API_PASSWORD']
16
+ self.class.base_uri ENV['CENTAMAN_API']
17
+ after_init(args)
18
+ end
19
+
20
+ def headers
21
+ { 'authorization' => "Basic #{encoded_string}", 'Content-Type' => 'application/json' }
22
+ end
23
+
24
+ def encoded_string
25
+ @encoded_string ||= Base64.encode64("#{api_username}:#{api_password}")
26
+ end
27
+
28
+ def options
29
+ [] # overwritten by children
30
+ end
31
+
32
+ def options_hash
33
+ hash = {}
34
+ options.each do |option_hash|
35
+ next unless option_hash[:value].present?
36
+ hash[option_hash[:key]] = option_hash[:value]
37
+ end
38
+ hash
39
+ end
40
+
41
+ def after_init(args = {})
42
+ # hook method for subclasses
43
+ end
44
+ end
45
+ end
metadata ADDED
@@ -0,0 +1,140 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: centaman
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - francirp
8
+ - dianacamacho
9
+ autorequire:
10
+ bindir: exe
11
+ cert_chain: []
12
+ date: 2017-08-02 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '1.14'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '1.14'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '10.0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '10.0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rspec
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '3.0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '3.0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: httparty
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ description: Wrapper for the Centaman Ticketing API
71
+ email:
72
+ - ryan@launchpadlab.com
73
+ - dcam1901@gmail.com
74
+ executables: []
75
+ extensions: []
76
+ extra_rdoc_files: []
77
+ files:
78
+ - ".gitignore"
79
+ - ".rspec"
80
+ - ".travis.yml"
81
+ - Gemfile
82
+ - LICENSE.txt
83
+ - README.md
84
+ - Rakefile
85
+ - bin/console
86
+ - bin/setup
87
+ - centaman.gemspec
88
+ - lib/centaman.rb
89
+ - lib/centaman/attribute.rb
90
+ - lib/centaman/filter.rb
91
+ - lib/centaman/json_wrapper.rb
92
+ - lib/centaman/object.rb
93
+ - lib/centaman/object/booking_time.rb
94
+ - lib/centaman/object/booking_type.rb
95
+ - lib/centaman/object/capacity.rb
96
+ - lib/centaman/object/coupon_check.rb
97
+ - lib/centaman/object/customer.rb
98
+ - lib/centaman/object/effect.rb
99
+ - lib/centaman/object/extra.rb
100
+ - lib/centaman/object/gift_ticket.rb
101
+ - lib/centaman/object/purchased_ticket.rb
102
+ - lib/centaman/object/ticket_type.rb
103
+ - lib/centaman/service.rb
104
+ - lib/centaman/service/booking_time.rb
105
+ - lib/centaman/service/booking_type.rb
106
+ - lib/centaman/service/capacity.rb
107
+ - lib/centaman/service/coupon_check.rb
108
+ - lib/centaman/service/create_customer.rb
109
+ - lib/centaman/service/extra.rb
110
+ - lib/centaman/service/gift_ticket.rb
111
+ - lib/centaman/service/purchase_ticket.rb
112
+ - lib/centaman/service/ticket_type.rb
113
+ - lib/centaman/version.rb
114
+ - lib/centaman/wrapper.rb
115
+ homepage: https://github.com/LaunchPadLab/centaman
116
+ licenses:
117
+ - MIT
118
+ metadata:
119
+ allowed_push_host: https://rubygems.org
120
+ post_install_message:
121
+ rdoc_options: []
122
+ require_paths:
123
+ - lib
124
+ required_ruby_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ required_rubygems_version: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ requirements: []
135
+ rubyforge_project:
136
+ rubygems_version: 2.5.1
137
+ signing_key:
138
+ specification_version: 4
139
+ summary: Wrapper for the Centaman Ticketing API
140
+ test_files: []