Method: Xunch::JsonCodec#encode_fields

Defined in:
lib/xunch/codec/json_codec.rb

#encode_fields(value, fields) ⇒ Object



50
51
52
53
54
55
56
57
58
59
# File 'lib/xunch/codec/json_codec.rb', line 50

def encode_fields(value,fields)
  hash = Hash.new
  @get_methods.each do | k , v |
    var_value = value.send(v)
    if var_value != nil
      hash[k] = var_value
    end
  end
  hash
end