Module: Puppet::Pops::Types::PCallableType::ClassModule

Defined in:
lib/puppet/pops/types/types.rb

Instance Method Summary collapse

Instance Method Details

#==(o) ⇒ Object



402
403
404
# File 'lib/puppet/pops/types/types.rb', line 402

def ==(o)
  self.class == o.class && args_type == o.args_type && block_type == o.block_type
end

#block_rangeObject

Range [0,0], [0,1], or [1,1] for the block



387
388
389
390
391
392
393
394
395
396
# File 'lib/puppet/pops/types/types.rb', line 387

def block_range
  case block_type
  when Puppet::Pops::Types::POptionalType
    [0,1]
  when Puppet::Pops::Types::PVariantType, Puppet::Pops::Types::PCallableType
    [1,1]
  else
    [0,0]
  end
end

#hashObject



398
399
400
# File 'lib/puppet/pops/types/types.rb', line 398

def hash
  [self.class, Set.new(param_types), block_type].hash
end

#last_rangeObject

Returns the number of accepted arguments for the last parameter type [min, max]



381
382
383
# File 'lib/puppet/pops/types/types.rb', line 381

def last_range
  param_types.repeat_last_range
end

#size_rangeObject

Returns the number of accepted arguments [min, max]



375
376
377
# File 'lib/puppet/pops/types/types.rb', line 375

def size_range
  param_types.size_range
end