Sha256: b54b7b52e74278a844cc728e5bd71137b8e0305d13094f6f5f324e42bfb03b06

Contents?: true

Size: 822 Bytes

Versions: 7

Compression:

Stored size: 822 Bytes

Contents

module TheCity

  class WebHook < ApiObject

    Objects = {:user => 'User', :group => 'Group', :invitation => 'Invitation',
               :privilege => 'Privilege', :checkin => 'Checkin', :address => 'Address'}

    Events = {:create => 'create', :update => 'update', :destroy => 'destroy', :expire => 'expire'}              


    tc_attr_accessor :id,
                     :callback_uri, 
                     :event,
                     :object

    # Constructor.
    #
    # @param json_data (optional) JSON data of the web hook.
    def initialize(json_data = nil)
      @writer_object = WebHookWriter
      initialize_from_json_object(json_data) unless json_data.nil?
    end


    # The name of the hook based on the event and object
    def name
      "#{self.object}::#{self.event}"
    end
    
  end

end


Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
the-city-admin-0.2.0 lib/api/web_hook.rb
the-city-admin-0.1.5 lib/api/web_hook.rb
the-city-admin-0.1.4 lib/api/web_hook.rb
the-city-admin-0.1.3 lib/api/web_hook.rb
the-city-admin-0.1.2 lib/api/web_hook.rb
the-city-admin-0.1.1 lib/api/web_hook.rb
the-city-admin-0.1.0 lib/api/web_hook.rb