Class: RSpec::Undefined::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/undefined/entry.rb

Constant Summary collapse

ATTRS =
[:kind, :matcher, :description, :category, :expected, :actual,
:matched, :location, :example_id].freeze

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Entry

Returns a new instance of Entry.



11
12
13
# File 'lib/rspec/undefined/entry.rb', line 11

def initialize(attrs = {})
  ATTRS.each { |a| instance_variable_set("@#{a}", attrs[a]) }
end

Instance Method Details

#to_hObject



15
16
17
# File 'lib/rspec/undefined/entry.rb', line 15

def to_h
  ATTRS.each_with_object({}) { |a, h| h[a] = instance_variable_get("@#{a}") }
end