class Inject::Rule

Attributes

identifier[R]
key[R]
options[R]
value[R]

Public Class Methods

new(key, identifier, value, **options) click to toggle source
# File lib/inject/rule.rb, line 4
def initialize(key, identifier, value, **options)
  @key = key
  @identifier = identifier
  @value = value
  @options = options
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/inject/rule.rb, line 11
def <=>(other)
  # this one has before: :all or before: other
  [other.identifier, :all].include?(self.options[:before]) ||
    # other one has after: :all, or after: self
    [self.identifier, :all].include?(other.options[:after])
end