Class: AnyValue::StringOfLength
- Defined in:
- lib/any_value.rb
Instance Method Summary collapse
- #==(o) ⇒ Object
-
#initialize(expected_length) ⇒ StringOfLength
constructor
A new instance of StringOfLength.
- #inspect ⇒ Object
Methods inherited from AnyString
Methods inherited from Anything
Constructor Details
#initialize(expected_length) ⇒ StringOfLength
Returns a new instance of StringOfLength.
134 135 136 137 |
# File 'lib/any_value.rb', line 134 def initialize(expected_length) super @expected_length = expected_length end |
Instance Method Details
#==(o) ⇒ Object
139 140 141 |
# File 'lib/any_value.rb', line 139 def ==(o) super && o.length == @expected_length end |
#inspect ⇒ Object
143 144 145 |
# File 'lib/any_value.rb', line 143 def inspect "#<StringOfLength #@expected_length>" end |