Class: Mal::LengthT

Inherits:
OnlyT
  • Object
show all
Defined in:
lib/mal.rb

Direct Known Subclasses

MaxLengthT, MinLengthT

Instance Method Summary collapse

Methods inherited from OnlyT

#&, #|

Constructor Details

#initialize(desired_length) ⇒ LengthT

Returns a new instance of LengthT.



188
189
190
# File 'lib/mal.rb', line 188

def initialize(desired_length)
  @desired_length = length
end

Instance Method Details

#===(value) ⇒ Object



192
193
194
195
# File 'lib/mal.rb', line 192

def ===(value)
  return false unless value.respond_to? :length
  @desired_length == value.length
end

#inspectObject



197
# File 'lib/mal.rb', line 197

def inspect; 'OfElements(%d)' % @desired_length; end