Class: Tickspot::Request
- Inherits:
-
Object
- Object
- Tickspot::Request
- Defined in:
- lib/tickspot.rb
Class Method Summary collapse
-
.post(options) ⇒ Array
Send a post request to Tickspot.
Class Method Details
.post(options) ⇒ Array
Send a post request to Tickspot. Will use Tickspot.company and Tickspot.section to build the url and passes every op tion it received ( merged with Tickspot.email and Tickspot.password ) to HTTParty’s :query parameter. It’ll return everythin within the returned root node ( which is named equally to the section name ).
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/tickspot.rb', line 22 def self.post() section = .delete(:section) result = HTTParty.post( "https://#{Tickspot.company}.tickspot.com/api/#{section}", :query => .merge({ :email => Tickspot.email, :password => Tickspot.password }) ) result[section.to_s] end |