Module: Bullfrog
- Includes:
- HTTParty
- Defined in:
- lib/bullfrog.rb,
lib/bullfrog/version.rb
Defined Under Namespace
Classes: TTS
Constant Summary collapse
- API_VERSION =
1- VERSION =
"0.0.2"
Class Attribute Summary collapse
-
.api_key ⇒ Object
Returns the value of attribute api_key.
Class Method Summary collapse
- .api_options(options) ⇒ Object
- .api_url(url) ⇒ Object
- .get(url, options = {}) ⇒ Object
- .post(url, options = {}) ⇒ Object
- .put(url, options = {}) ⇒ Object
Class Attribute Details
.api_key ⇒ Object
Returns the value of attribute api_key.
11 12 13 |
# File 'lib/bullfrog.rb', line 11 def api_key @api_key end |
Class Method Details
.api_options(options) ⇒ Object
27 28 29 30 31 |
# File 'lib/bullfrog.rb', line 27 def () [:body] ||= {} [:body][:api_key] = @api_key end |
.api_url(url) ⇒ Object
24 25 26 |
# File 'lib/bullfrog.rb', line 24 def api_url(url) "/api/v#{API_VERSION}/#{url}.js" end |
.get(url, options = {}) ⇒ Object
16 17 18 19 |
# File 'lib/bullfrog.rb', line 16 def get(url, = {}) response = super(api_url(url), ()) JSON.parse(response.body) end |
.post(url, options = {}) ⇒ Object
12 13 14 15 |
# File 'lib/bullfrog.rb', line 12 def post(url, = {}) response = super(api_url(url), ()) JSON.parse(response.body) end |
.put(url, options = {}) ⇒ Object
20 21 22 23 |
# File 'lib/bullfrog.rb', line 20 def put(url, = {}) response = super(api_url(url), ()) JSON.parse(response.body) end |