Class: Mal::MaxLengthT

Inherits:
LengthT show all
Defined in:
lib/mal.rb

Instance Method Summary collapse

Methods inherited from LengthT

#initialize

Methods inherited from OnlyT

#&, #initialize, #|

Constructor Details

This class inherits a constructor from Mal::LengthT

Instance Method Details

#===(value) ⇒ Object



209
210
211
212
# File 'lib/mal.rb', line 209

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

#inspectObject



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

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