123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Core::Formatters::DeprecationFormatter::GeneratedDeprecationMessage Private

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Struct
Instance Chain:
self, Struct
Inherits: Struct
  • Object
Defined in: rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(data) ⇒ GeneratedDeprecationMessage

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 95

def initialize(data)
  @data = data
  super data.deprecated
end

Instance Attribute Details

#type (rw)

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 94

GeneratedDeprecationMessage = Struct.new(:type)

Instance Method Details

#to_s

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 100

def to_s
  msg = String.new("#{@data.deprecated} is deprecated.")
  msg << " Use #{@data.replacement} instead." if @data.replacement
  msg << " Called from #{@data.call_site}."   if @data.call_site
  msg
end

#too_many_warnings_message

[ GitHub ]

  
# File 'rspec-core/lib/rspec/core/formatters/deprecation_formatter.rb', line 107

def too_many_warnings_message
  "Too many uses of deprecated '#{type}'. #{DEPRECATION_STREAM_NOTICE}"
end