Class: Legion::Extensions::Absorbers::Matchers::Url

Inherits:
Base
  • Object
show all
Defined in:
lib/legion/extensions/absorbers/matchers/url.rb

Constant Summary

Constants included from Definitions

Definitions::DEFAULTS

Constants included from Helpers::Base

Helpers::Base::NAMESPACE_BOUNDARIES

Instance Attribute Summary

Attributes inherited from Base

#job_id, #runners

Class Method Summary collapse

Methods inherited from Base

#absorb, #absorb_raw, #absorb_to_knowledge, description, pattern, patterns, #report_progress, #translate, #with_token

Methods included from Definitions

#definition, #definition_for, #definitions

Methods included from Helpers::Lex

#default_settings, included, #runner_desc

Methods included from Helpers::Base

#actor_class, #actor_const, #actor_name, #amqp_prefix, #calling_class, #calling_class_array, #from_json, #full_path, #lex_class, #lex_const, #lex_name, #lex_slug, #log_tag, #normalize, #runner_class, #runner_const, #runner_name, #segments, #settings_path, #table_prefix, #to_dotted_hash

Methods included from Helpers::Task

#generate_task_id, #generate_task_log, #task_update

Methods included from Helpers::Logger

#handle_runner_exception

Methods included from Helpers::Secret

reset_identity!, resolve_identity!, #secret

Methods included from Helpers::Core

#find_setting

Class Method Details

.match?(pattern, input) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
15
16
17
18
19
20
# File 'lib/legion/extensions/absorbers/matchers/url.rb', line 12

def self.match?(pattern, input)
  uri = parse_uri(input)
  return false unless uri

  host_pattern, path_pattern = split_pattern(pattern)
  return false unless host_matches?(host_pattern, uri.host)

  path_matches?(path_pattern || '**', uri.path)
end

.typeObject



10
# File 'lib/legion/extensions/absorbers/matchers/url.rb', line 10

def self.type = :url