Class: APIHub::Watchlist

Inherits:
Base show all
Defined in:
lib/apihub/watchlist.rb

Direct Known Subclasses

Entity, Individual

Defined Under Namespace

Classes: Entity, Individual

Class Method Summary collapse

Methods inherited from Resource

delete, endpoint, get, options, path, post, put, request, uri, url

Methods inherited from Mash

#custom_reader, #custom_writer, #deep_merge, #deep_update, #delete, #dup, #fetch, #id, #initialize, #initializing_reader, #key?, #method_missing, new, #regular_dup, #replace, #respond_to?, #shallow_merge, #shallow_update, #type, #underbang_reader

Constructor Details

This class inherits a constructor from APIHub::Mash

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class APIHub::Mash

Class Method Details

.search(name, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/apihub/watchlist.rb', line 6

def self.search(name, options = {})
  options = options.dup
  params  = options.delete(:params) || {}

  params  = {
    name:      name,
    threshold: options.delete(:threshold) || 1.0
  }.merge(params)

  response = post('', params, options)

  self.new(response)
end