class PageMagic::Comparator

class Comparator - used for comparing components used for mapping pages

Attributes

comparator[R]
fuzzy[R]

Public Class Methods

for(comparator) click to toggle source
# File lib/page_magic/comparator.rb, line 12
def for(comparator)
  klass = { Regexp => Fuzzy, Hash => ParameterMap, NilClass => Null }.fetch(comparator.class, Literal)
  klass.new(comparator)
end
new(comparator, fuzzy) click to toggle source
# File lib/page_magic/comparator.rb, line 20
def initialize(comparator, fuzzy)
  @comparator = comparator
  @fuzzy = fuzzy
end

Public Instance Methods

==(other) click to toggle source
# File lib/page_magic/comparator.rb, line 33
def ==(other)
  comparator == other.comparator
end
fuzzy?() click to toggle source
# File lib/page_magic/comparator.rb, line 25
def fuzzy?
  fuzzy
end
to_s() click to toggle source
# File lib/page_magic/comparator.rb, line 29
def to_s
  comparator.to_s
end