Class: Shaped::Shapes::Equality

Inherits:
Shaped::Shape show all
Defined in:
lib/shaped/shapes/equality.rb

Instance Method Summary collapse

Constructor Details

#initialize(shape_description) ⇒ Equality

Returns a new instance of Equality.



4
5
6
# File 'lib/shaped/shapes/equality.rb', line 4

def initialize(shape_description)
  @expected_value = shape_description
end

Instance Method Details

#matched_by?(object) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/shaped/shapes/equality.rb', line 8

def matched_by?(object)
  object == @expected_value
end

#to_sObject



12
13
14
# File 'lib/shaped/shapes/equality.rb', line 12

def to_s
  @expected_value.inspect
end