class Nylas::Event
Public Instance Methods
as_json(options = {})
click to toggle source
Calls superclass method
# File lib/event.rb, line 19 def as_json(options = {}) hash = super(options) # Delete nil values from the hash hash.delete_if { |key, value| value.nil? } # The API doesn't like to receive: "object": "timespan" in the when block. if hash.has_key?('when') and hash['when'].has_key?('object') hash['when'].delete('object') end return hash end
rsvp!(status, comment)
click to toggle source
# File lib/event.rb, line 33 def rsvp!(status, comment) url = @_api.url_for_path("/send-rsvp") data = {:event_id => @id, :status => status, :comment => comment} ::RestClient.post(url, data.to_json, :content_type => :json) do |response, request, result| json = Nylas.interpret_response(result, response, :expected_class => Object) self.inflate(json) end self end