Sha256: a9301d4d1e9f8492206d2c98ee995aad70050ab1fdb08dac36162a4a4155af78
Contents?: true
Size: 938 Bytes
Versions: 3
Compression:
Stored size: 938 Bytes
Contents
# Endow A library to assist in consuming API endpoints. ## Installation Add this line to your application's Gemfile: gem 'endow' And then execute: $ bundle Or install it yourself as: $ gem install endow ## Usage ### Setting URI Content (URI Parameters) Restful URIs sometimes use templated URI parameters, a la Rails, ie. `/people/:id` or `people/:person_id/things`. To set the content of the URI parmeters use the `#set_uri_content` method. You must implement the `#endpoint_template` method as opposed to the `endpoint` method when using URI parameters. class SomeEndpoint < Endow::Endpoint def initialize( attributes ) @attributes = attributes set_uri_content( attributes.slice( :person_id )) set_content( attributes.slice( :thing )) end def endpoint_template 'people/:person_id/things' end def http_verb :post end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
endow-1.2.1 | README.md |
endow-1.2.0 | README.md |
endow-1.1.0 | README.md |