Sha256: cbc86353ac448cfee2a9b72f4706af8691a9cf42a8ad8eff3d0b483fdf1ab7fe

Contents?: true

Size: 926 Bytes

Versions: 19

Compression:

Stored size: 926 Bytes

Contents

module TheCity

  class WebHook < ApiObject

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

    Objects = {:user => 'user', :group => 'group', :invitation => 'invitation',
               :privilege => 'privilege', :checkin => 'checkin', :address => 'address',
               :group_tag => 'group_tag', :fund => 'fund', :pledge => 'pledge', :donation => 'donation'}

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

    # 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

19 entries across 19 versions & 1 rubygems

Version Path
the-city-admin-0.7.1 lib/api/web_hook.rb
the-city-admin-0.7.0 lib/api/web_hook.rb
the-city-admin-0.6.9 lib/api/web_hook.rb
the-city-admin-0.6.8 lib/api/web_hook.rb
the-city-admin-0.6.7 lib/api/web_hook.rb
the-city-admin-0.6.6 lib/api/web_hook.rb
the-city-admin-0.6.5 lib/api/web_hook.rb
the-city-admin-0.6.4 lib/api/web_hook.rb
the-city-admin-0.6.3 lib/api/web_hook.rb
the-city-admin-0.6.2 lib/api/web_hook.rb
the-city-admin-0.6.1 lib/api/web_hook.rb
the-city-admin-0.6.0 lib/api/web_hook.rb
the-city-admin-0.5.2 lib/api/web_hook.rb
the-city-admin-0.5.1 lib/api/web_hook.rb
the-city-admin-0.5.0 lib/api/web_hook.rb
the-city-admin-0.4.0 lib/api/web_hook.rb
the-city-admin-0.3.1 lib/api/web_hook.rb
the-city-admin-0.3.0 lib/api/web_hook.rb
the-city-admin-0.2.1 lib/api/web_hook.rb