Class: Querly::Rule::Example

Inherits:
Object
  • Object
show all
Defined in:
lib/querly/rule.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(before:, after:) ⇒ Example

Returns a new instance of Example.



7
8
9
10
# File 'lib/querly/rule.rb', line 7

def initialize(before:, after:)
  @before = before
  @after = after
end

Instance Attribute Details

#afterObject (readonly)

Returns the value of attribute after.



5
6
7
# File 'lib/querly/rule.rb', line 5

def after
  @after
end

#beforeObject (readonly)

Returns the value of attribute before.



4
5
6
# File 'lib/querly/rule.rb', line 4

def before
  @before
end

Instance Method Details

#==(other) ⇒ Object



12
13
14
# File 'lib/querly/rule.rb', line 12

def ==(other)
  other.is_a?(Example) && other.before == before && other.after == after
end