Class: Gem::SafeMarshal::Visitors::Visitor
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Inherits: | Object |
Defined in: | lib/rubygems/safe_marshal/visitors/visitor.rb |
Constant Summary
-
DISPATCH =
private
# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 11Gem::SafeMarshal::Elements.constants.each_with_object({}) do |c, h| next if c == :Element klass = Gem::SafeMarshal::Elements.const_get(c) h[klass] = :"visit_#{klass.name.gsub("::", "_")}" h.default = :visit_unknown_element end.compare_by_identity.freeze
Instance Method Summary
- #visit(target)
- #visit_Gem_SafeMarshal_Elements_Array(target) private
- #visit_Gem_SafeMarshal_Elements_Bignum(target) private
- #visit_Gem_SafeMarshal_Elements_False(target) private
- #visit_Gem_SafeMarshal_Elements_Float(target) private
- #visit_Gem_SafeMarshal_Elements_Hash(target) private
- #visit_Gem_SafeMarshal_Elements_HashWithDefaultValue(target) private
- #visit_Gem_SafeMarshal_Elements_Integer(target) private
- #visit_Gem_SafeMarshal_Elements_Nil(target) private
- #visit_Gem_SafeMarshal_Elements_Object(target) private
- #visit_Gem_SafeMarshal_Elements_ObjectLink(target) private
- #visit_Gem_SafeMarshal_Elements_String(target) private
- #visit_Gem_SafeMarshal_Elements_Symbol(target) private
- #visit_Gem_SafeMarshal_Elements_SymbolLink(target) private
- #visit_Gem_SafeMarshal_Elements_True(target) private
- #visit_Gem_SafeMarshal_Elements_UserDefined(target) private
- #visit_Gem_SafeMarshal_Elements_UserMarshal(target) private
- #visit_Gem_SafeMarshal_Elements_WithIvars(target) private
- #visit_unknown_element(e) private
Instance Method Details
#visit(target)
[ GitHub ]# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 5
def visit(target) send DISPATCH.fetch(target.class), target end
#visit_Gem_SafeMarshal_Elements_Array(target) (private)
[ GitHub ]# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 24
def visit_Gem_SafeMarshal_Elements_Array(target) target.elements.each {|e| visit(e) } end
#visit_Gem_SafeMarshal_Elements_Bignum(target) (private)
[ GitHub ]# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 28
def visit_Gem_SafeMarshal_Elements_Bignum(target); end
#visit_Gem_SafeMarshal_Elements_False(target) (private)
[ GitHub ]# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 29
def visit_Gem_SafeMarshal_Elements_False(target); end
#visit_Gem_SafeMarshal_Elements_Float(target) (private)
[ GitHub ]# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 30
def visit_Gem_SafeMarshal_Elements_Float(target); end
#visit_Gem_SafeMarshal_Elements_Hash(target) (private)
[ GitHub ]#visit_Gem_SafeMarshal_Elements_HashWithDefaultValue(target) (private)
[ GitHub ]# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 39
def visit_Gem_SafeMarshal_Elements_HashWithDefaultValue(target) visit_Gem_SafeMarshal_Elements_Hash(target) visit(target.default) end
#visit_Gem_SafeMarshal_Elements_Integer(target) (private)
[ GitHub ]# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 44
def visit_Gem_SafeMarshal_Elements_Integer(target); end
#visit_Gem_SafeMarshal_Elements_Nil(target) (private)
[ GitHub ]# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 45
def visit_Gem_SafeMarshal_Elements_Nil(target); end
#visit_Gem_SafeMarshal_Elements_Object(target) (private)
[ GitHub ]# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 47
def visit_Gem_SafeMarshal_Elements_Object(target) visit(target.name) end
#visit_Gem_SafeMarshal_Elements_ObjectLink(target) (private)
[ GitHub ]# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 51
def visit_Gem_SafeMarshal_Elements_ObjectLink(target); end
#visit_Gem_SafeMarshal_Elements_String(target) (private)
[ GitHub ]# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 52
def visit_Gem_SafeMarshal_Elements_String(target); end
#visit_Gem_SafeMarshal_Elements_Symbol(target) (private)
[ GitHub ]# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 53
def visit_Gem_SafeMarshal_Elements_Symbol(target); end
#visit_Gem_SafeMarshal_Elements_SymbolLink(target) (private)
[ GitHub ]# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 54
def visit_Gem_SafeMarshal_Elements_SymbolLink(target); end
#visit_Gem_SafeMarshal_Elements_True(target) (private)
[ GitHub ]# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 55
def visit_Gem_SafeMarshal_Elements_True(target); end
#visit_Gem_SafeMarshal_Elements_UserDefined(target) (private)
[ GitHub ]# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 57
def visit_Gem_SafeMarshal_Elements_UserDefined(target) visit(target.name) end
#visit_Gem_SafeMarshal_Elements_UserMarshal(target) (private)
[ GitHub ]#visit_Gem_SafeMarshal_Elements_WithIvars(target) (private)
[ GitHub ]#visit_unknown_element(e) (private)
# File 'lib/rubygems/safe_marshal/visitors/visitor.rb', line 20
def visit_unknown_element(e) raise ArgumentError, "Attempting to visit unknown element #{e.inspect}" end