Sha256: 777206deeb97b8eab2a743fb8098712aa737bc13d56df0a0d2677c80b4aec04c
Contents?: true
Size: 652 Bytes
Versions: 6
Compression:
Stored size: 652 Bytes
Contents
require 'restful_model' module Inbox class Event < RestfulModel parameter :title parameter :description parameter :location parameter :read_only parameter :participants parameter :when parameter :calendar_id parameter :namespace_id 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 end end
Version data entries
6 entries across 6 versions & 1 rubygems
Version | Path |
---|---|
inbox-0.15.1 | lib/event.rb |
inbox-0.15.0 | lib/event.rb |
inbox-0.14.1 | lib/event.rb |
inbox-0.14.0 | lib/event.rb |
inbox-0.13.0 | lib/event.rb |
inbox-0.12.0 | lib/event.rb |