Class | Request::Query |
In: |
lib/violet/request.rb
|
Parent: | Object |
this class is used to "translate" our Events into URLs. Examples:
TODO
create a new Query object with the give parameters. serial and token parameters should be checked at a higher level. event parameter is usually an Event object, but you can give any Object that respond to to_url.
# File lib/violet/request.rb, line 87 87: def initialize h 88: raise ArgumentError.new('event parameter has no "to_url" method or is empty') unless h[:event] and h[:event].respond_to?(:to_url) 89: raise ArgumentError.new('need a :serial') unless h[:serial] 90: raise ArgumentError.new('need a :token' ) unless h[:token] 91: 92: @event, @serial, @token = h[:event], h[:serial], h[:token] 93: end