Class: RSpec::DescriptionConsistency::State
- Inherits:
-
Object
- Object
- RSpec::DescriptionConsistency::State
- Defined in:
- lib/rspec/description_consistency/state.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #add_entry(class_name:, method_name:, payload:) ⇒ Object
- #any? ⇒ Boolean
-
#initialize ⇒ State
constructor
A new instance of State.
Constructor Details
#initialize ⇒ State
Returns a new instance of State.
11 12 13 |
# File 'lib/rspec/description_consistency/state.rb', line 11 def initialize @data = {} end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
9 10 11 |
# File 'lib/rspec/description_consistency/state.rb', line 9 def data @data end |
Instance Method Details
#add_entry(class_name:, method_name:, payload:) ⇒ Object
19 20 21 |
# File 'lib/rspec/description_consistency/state.rb', line 19 def add_entry(class_name:, method_name:, payload:) (data[[class_name, method_name]] ||= Set.new) << payload end |
#any? ⇒ Boolean
15 16 17 |
# File 'lib/rspec/description_consistency/state.rb', line 15 def any? @data.any? end |