Class: Rules

Inherits:
Object show all
Defined in:
lib/jirametrics/rules.rb

Instance Method Summary collapse

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


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

def eql?(other)
  (other.class == self.class) && (other.state == state)
end

#hashObject



20
21
22
# File 'lib/jirametrics/rules.rb', line 20

def hash
  2 # TODO: While this work, it's not performant
end

#ignoreObject



4
5
6
# File 'lib/jirametrics/rules.rb', line 4

def ignore
  @ignore = true
end

#ignored?Boolean

Returns:

  • (Boolean)


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

def ignored?
  @ignore == true
end

#inspectObject



24
25
26
27
28
29
30
31
32
# File 'lib/jirametrics/rules.rb', line 24

def inspect
  result = String.new
  result << "#{self.class}("
  result << instance_variables.collect do |variable|
    "#{variable}=#{instance_variable_get(variable).inspect}"
  end.join(', ')
  result << ')'
  result
end

#stateObject



16
17
18
# File 'lib/jirametrics/rules.rb', line 16

def state
  instance_variables.map { |variable| instance_variable_get variable }
end