Class: EventQ::SerializationProviders::JRuby::Oj::ClassWriter

Inherits:
AttributeWriter
  • Object
show all
Defined in:
lib/eventq_base/serialization_providers/jruby/oj/class_writer.rb

Instance Method Summary collapse

Methods inherited from AttributeWriter

descendants, exec

Instance Method Details

#exec(obj) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/eventq_base/serialization_providers/jruby/oj/class_writer.rb', line 9

def exec(obj)
  hash = { '^o': obj.class }
  obj.instance_variables.each do |key|
    hash[key[1..-1]] = AttributeWriter.exec(obj.instance_variable_get(key))
  end
  hash
end

#valid?(obj) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/eventq_base/serialization_providers/jruby/oj/class_writer.rb', line 6

def valid?(obj)
  false
end