Class: Coppertone::Mechanism::All

Inherits:
Coppertone::Mechanism show all
Defined in:
lib/coppertone/mechanism/all.rb

Overview

Implements the All mechanism. To reduce unnecessary object creation, this class is a singleton since all All mechanisms behave identically.

Constant Summary collapse

SINGLETON =
new

Instance Attribute Summary

Attributes inherited from Coppertone::Mechanism

#arguments

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Coppertone::Mechanism

build, class_builder, #context_dependent?, dns_lookup_term?, #dns_lookup_term?, #includes_ptr?, register, #to_s

Constructor Details

#initializeAll

Returns a new instance of All.



20
21
22
# File 'lib/coppertone/mechanism/all.rb', line 20

def initialize
  super('')
end

Class Method Details

.create(attributes) ⇒ Object



6
7
8
9
10
# File 'lib/coppertone/mechanism/all.rb', line 6

def self.create(attributes)
  raise InvalidMechanismError unless attributes.blank?

  SINGLETON
end

.instanceObject



12
13
14
# File 'lib/coppertone/mechanism/all.rb', line 12

def self.instance
  SINGLETON
end

.labelObject



16
17
18
# File 'lib/coppertone/mechanism/all.rb', line 16

def self.label
  'all'
end

Instance Method Details

#match?(_macro_context, _request_context) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/coppertone/mechanism/all.rb', line 26

def match?(_macro_context, _request_context)
  true
end