Method: ESP::Tag.find

Defined in:
lib/esp/resources/tag.rb

.find(id) ⇒ Object .find(scope, options) ⇒ Object

Find a Tag by id

call-seq -> super.find(id)

Overloads:

  • .find(id) ⇒ Object

    Parameters:

    • id (Integer, Numeric)

      Required ID of the tag to retrieve.

  • .find(scope, options) ⇒ Object

    This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

    call-seq -> super.all(options)

    Parameters:

    • scope (Object)

      Example: :all

    • options (Hash)

      params: { alert_id: Integer }

    Raises:

    • (ArgumentError)

      if no alert_id is supplied.



50
51
52
53
54
55
56
57
# File 'lib/esp/resources/tag.rb', line 50

def self.find(*arguments)
  scope = arguments.slice!(0)
  options = (arguments.slice!(0) || {}).with_indifferent_access
  return super(scope, options) if scope.is_a?(Numeric) || options[:from].present?
  params = options.fetch(:params, {}).with_indifferent_access
  alert_id = params.delete(:alert_id)
  for_alert(alert_id)
end