Class: TrustedSearch::V2::Hook

Inherits:
ApiVersion2 show all
Defined in:
lib/trustedsearch/v2/hooks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ApiVersion2

#base_path, #request

Methods inherited from APIResource

#base_path, #class_name, #delete, #end_point, #get, #get_time, #has_keys, #post, #process, #put, #request, #sign_request

Constructor Details

#initializeHook

Returns a new instance of Hook.



6
7
8
# File 'lib/trustedsearch/v2/hooks.rb', line 6

def initialize
  @resource = 'hooks'
end

Instance Attribute Details

#resourceObject

Returns the value of attribute resource.



4
5
6
# File 'lib/trustedsearch/v2/hooks.rb', line 4

def resource
  @resource
end

Instance Method Details

#indexObject

Retrieve an array of all available hooks



11
12
13
14
# File 'lib/trustedsearch/v2/hooks.rb', line 11

def index()
  method_url = @resource
  return self.get(method_url)
end

#show(id = nil) ⇒ Object

Get the details of a single hook



17
18
19
20
21
# File 'lib/trustedsearch/v2/hooks.rb', line 17

def show(id = nil)
  method_url = @resource + "/" + id
  params = {}
  return self.get(method_url, params)
end