Class: MOCO::WebHook

Inherits:
BaseEntity show all
Defined in:
lib/moco/entities/web_hook.rb

Overview

Represents a MOCO webhook Provides methods for webhook-specific operations

Instance Attribute Summary

Attributes inherited from BaseEntity

#attributes, #client

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseEntity

#==, #association, #destroy, #eql?, #has_many, #hash, #id, #initialize, #inspect, #reload, #save, #to_h, #to_json, #update

Constructor Details

This class inherits a constructor from MOCO::BaseEntity

Class Method Details

.entity_pathObject

Override entity_path to match API path



8
9
10
# File 'lib/moco/entities/web_hook.rb', line 8

def self.entity_path
  "account/web_hooks"
end

Instance Method Details

#disableObject



18
19
20
21
# File 'lib/moco/entities/web_hook.rb', line 18

def disable
  client.put("account/web_hooks/#{id}/disable")
  self
end

#enableObject

Instance methods for webhook-specific operations



13
14
15
16
# File 'lib/moco/entities/web_hook.rb', line 13

def enable
  client.put("account/web_hooks/#{id}/enable")
  self
end

#to_sObject



23
24
25
# File 'lib/moco/entities/web_hook.rb', line 23

def to_s
  "#{target} - #{url}"
end