Class: RSpec::Core::Metadata::HashPopulator

Inherits:
Object
  • Object
show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/metadata.rb

Overview

Used internally to populate metadata hashes with computed keys managed by RSpec.

Direct Known Subclasses

ExampleGroupHash, ExampleHash

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metadata, user_metadata, index_provider, description_args, block) ⇒ HashPopulator

Returns a new instance of HashPopulator.



120
121
122
123
124
125
126
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/metadata.rb', line 120

def initialize(, , index_provider, description_args, block)
  @metadata         = 
  @user_metadata    = 
  @index_provider   = index_provider
  @description_args = description_args
  @block            = block
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



118
119
120
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/metadata.rb', line 118

def block
  @block
end

#description_argsObject (readonly)

Returns the value of attribute description_args.



118
119
120
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/metadata.rb', line 118

def description_args
  @description_args
end

#metadataObject (readonly)

Returns the value of attribute metadata.



118
119
120
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/metadata.rb', line 118

def 
  @metadata
end

#user_metadataObject (readonly)

Returns the value of attribute user_metadata.



118
119
120
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/metadata.rb', line 118

def 
  @user_metadata
end

Instance Method Details

#populateObject



128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/metadata.rb', line 128

def populate
  ensure_valid_user_keys

  [:block]            = block
  [:description_args] = description_args
  [:description]      = build_description_from(*[:description_args])
  [:full_description] = full_description
  [:described_class]  = described_class

  populate_location_attributes
  .update()
end