Class: Sawtooth::Rules::RuleEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/sawtooth/rules/set.rb

Overview

An entry in the ‘Set`.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, rule) ⇒ RuleEntry

Creates a new entry using path and the rule instance.



12
13
14
# File 'lib/sawtooth/rules/set.rb', line 12

def initialize(path, rule)
  self.path, self.rule = path, rule
end

Instance Attribute Details

#orig_pathObject (readonly)

Returns the value of attribute orig_path.



9
10
11
# File 'lib/sawtooth/rules/set.rb', line 9

def orig_path
  @orig_path
end

#pathObject

Both path and the rule are accessible.



8
9
10
# File 'lib/sawtooth/rules/set.rb', line 8

def path
  @path
end

#ruleObject

Both path and the rule are accessible.



8
9
10
# File 'lib/sawtooth/rules/set.rb', line 8

def rule
  @rule
end

Instance Method Details

#matches?(test) ⇒ Boolean

Returns ‘true` if the current path matches.

Returns:

  • (Boolean)


25
26
27
# File 'lib/sawtooth/rules/set.rb', line 25

def matches?(test)
  test =~ path
end