Module: Packet::Entity::Serialization
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/packet/entity/serialization.rb
Instance Method Summary collapse
- #to_hash ⇒ Object (also: #to_h)
Instance Method Details
#to_hash ⇒ Object Also known as: to_h
8 9 10 11 12 |
# File 'lib/packet/entity/serialization.rb', line 8 def to_hash instance_variables.reject { |ivar| [:@client].include?(ivar) }.map do |ivar| [ivar.to_s.tr('@', ''), instance_variable_get(ivar)] end.to_h end |