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

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

Instance Method Summary collapse

Instance Method Details

#==(o) ⇒ Object



335
336
337
# File 'lib/puppet/pops/types/types.rb', line 335

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



320
321
322
323
324
325
326
327
328
329
# File 'lib/puppet/pops/types/types.rb', line 320

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



331
332
333
# File 'lib/puppet/pops/types/types.rb', line 331

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]



314
315
316
# File 'lib/puppet/pops/types/types.rb', line 314

def last_range
  param_types.repeat_last_range
end

#size_rangeObject

Returns the number of accepted arguments [min, max]



308
309
310
# File 'lib/puppet/pops/types/types.rb', line 308

def size_range
  param_types.size_range
end