Class: Symbol

Inherits:
Object show all
Defined in:
lib/puppet/util/monkey_patches.rb

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/puppet/util/monkey_patches.rb', line 22

def <=> (other)
  if (other.class != Symbol)
    case Puppet[:strict]
    when :warning
      Puppet.warn_once('deprecation', 'symbol_comparison', 'Comparing Symbols to non-Symbol values is deprecated')
    when :error
      raise ArgumentError.new("Comparing Symbols to non-Symbol values is no longer allowed")
    end
  end
  self.to_s <=> other.to_s
end

#internObject



34
35
36
# File 'lib/puppet/util/monkey_patches.rb', line 34

def intern
  self
end