Class: GameMachine::GCache::Cache::ObjectWrapper

Inherits:
Object
  • Object
show all
Defined in:
server/lib/game_machine/gcache/cache.rb

Overview

Need this so JRuby doesn't convert certain objects to Java object, i.e. Strings with Encoding::BINARY

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(wrapped_object) ⇒ ObjectWrapper

Returns a new instance of ObjectWrapper


74
75
76
# File 'server/lib/game_machine/gcache/cache.rb', line 74

def initialize(wrapped_object)
  @wrapped_object = wrapped_object
end

Instance Attribute Details

#wrapped_objectObject (readonly)

Returns the value of attribute wrapped_object


72
73
74
# File 'server/lib/game_machine/gcache/cache.rb', line 72

def wrapped_object
  @wrapped_object
end

Instance Method Details

#==(other) ⇒ Object


82
83
84
# File 'server/lib/game_machine/gcache/cache.rb', line 82

def ==(other)
  other.is_a?(ObjectWrapper) && wrapped_object == other.wrapped_object
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)

78
79
80
# File 'server/lib/game_machine/gcache/cache.rb', line 78

def eql?(other)
  other.is_a?(ObjectWrapper) && wrapped_object.eql?(other.wrapped_object)
end

#hashObject


86
87
88
# File 'server/lib/game_machine/gcache/cache.rb', line 86

def hash
  wrapped_object.hash
end