Class/Module Index [+]

Quicksearch

RSpec::Core::HashImitatable

Mixin that makes the including class imitate a hash for backwards compatibility. The including class should use `attr_accessor` to declare attributes. @private

Public Class Methods

included(klass) click to toggle source
# File lib/rspec/core/metadata.rb, line 280
def self.included(klass)
  klass.extend ClassMethods
end

Public Instance Methods

[](key) click to toggle source
# File lib/rspec/core/metadata.rb, line 318
def [](key)
  issue_deprecation(:[], key)

  if directly_supports_attribute?(key)
    get_value(key)
  else
    extra_hash_attributes[key]
  end
end
[]=(key, value) click to toggle source
# File lib/rspec/core/metadata.rb, line 328
def []=(key, value)
  issue_deprecation(:[]=, key, value)

  if directly_supports_attribute?(key)
    set_value(key, value)
  else
    extra_hash_attributes[key] = value
  end
end
to_h() click to toggle source
# File lib/rspec/core/metadata.rb, line 284
def to_h
  hash = extra_hash_attributes.dup

  self.class.hash_attribute_names.each do |name|
    hash[name] = __send__(name)
  end

  hash
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.