Class: Gem::SafeMarshal::Elements::HashWithDefaultValue

Inherits:
Hash
  • Object
show all
Defined in:
lib/rubygems/safe_marshal/elements.rb

Instance Attribute Summary collapse

Attributes inherited from Hash

#pairs

Instance Method Summary collapse

Constructor Details

#initialize(pairs, default) ⇒ HashWithDefaultValue

Returns a new instance of HashWithDefaultValue.



51
52
53
54
# File 'lib/rubygems/safe_marshal/elements.rb', line 51

def initialize(pairs, default)
  super(pairs)
  @default = default
end

Instance Attribute Details

#defaultObject (readonly)

Returns the value of attribute default.



56
57
58
# File 'lib/rubygems/safe_marshal/elements.rb', line 56

def default
  @default
end