class Thrift::Types::Value::MapValue
Constants
- FIELDS
- NAME
- NAMESPACE
- THRIFT_FIELD_INDEX_ENTRIES
Public Class Methods
from_hash(v)
click to toggle source
# File lib/thrift/types/value.rb 26 def from_hash(v) 27 MapValue.new( 28 entries: v.reduce([]) do |acc, (k, vv)| 29 acc + [ 30 MapEntry.new( 31 key: Value.from_object(k), 32 value: Value.from_object(vv) 33 ) 34 ] 35 end 36 ) 37 end
Public Instance Methods
struct_fields()
click to toggle source
# File lib/thrift/types/value_types.rb 103 def struct_fields; FIELDS; end
to_hash()
click to toggle source
# File lib/thrift/types/value.rb 19 def to_hash 20 entries.reduce({}) do |acc, e| 21 acc.merge(e.key.to_object => e.value.to_object) 22 end 23 end
validate()
click to toggle source
# File lib/thrift/types/value_types.rb 105 def validate 106 raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field entries is unset!') unless @entries 107 end