Lines Matching refs:value
419 # We only assert on inspect value when there is one map entry because the
859 # enum with no default (integer value 0)
861 value :A, 1
1203 def value_from_ruby(value)
1205 case value
1207 ret.string_value = value
1209 ret.struct_value = value
1211 ret.struct_value = struct_from_ruby(value)
1213 ret.list_value = value
1215 ret.list_value = list_from_ruby(value)
1217 @log.error "Unknown type: #{value.class}"
1218 raise Google::Protobuf::Error, "Unknown type: #{value.class}"
1270 assert_equal 0.0, m.double.value
1271 assert_equal 0.0, m.float.value
1272 assert_equal 0, m.int32.value
1273 assert_equal 0, m.int64.value
1274 assert_equal 0, m.uint32.value
1275 assert_equal 0, m.uint64.value
1276 assert_equal false, m.bool.value
1277 assert_equal '', m.string.value
1278 assert_equal '', m.bytes.value
1282 double: Google::Protobuf::DoubleValue.new(value: 0.0),
1283 float: Google::Protobuf::FloatValue.new(value: 0.0),
1284 int32: Google::Protobuf::Int32Value.new(value: 0),
1285 int64: Google::Protobuf::Int64Value.new(value: 0),
1286 uint32: Google::Protobuf::UInt32Value.new(value: 0),
1287 uint64: Google::Protobuf::UInt64Value.new(value: 0),
1288 bool: Google::Protobuf::BoolValue.new(value: false),
1289 string: Google::Protobuf::StringValue.new(value: ""),
1290 bytes: Google::Protobuf::BytesValue.new(value: ''),
1302 assert_equal 2.0, m.double.value
1306 assert_equal 4.0, m.float.value
1310 assert_equal 3, m.int32.value
1314 assert_equal 4, m.int64.value
1318 assert_equal 5, m.uint32.value
1322 assert_equal 6, m.uint64.value
1326 assert_equal true, m.bool.value
1330 assert_equal "st\nr", m.string.value
1334 assert_equal 'fun', m.bytes.value
1339 double: Google::Protobuf::DoubleValue.new(value: 2.0),
1340 float: Google::Protobuf::FloatValue.new(value: 4.0),
1341 int32: Google::Protobuf::Int32Value.new(value: 3),
1342 int64: Google::Protobuf::Int64Value.new(value: 4),
1343 uint32: Google::Protobuf::UInt32Value.new(value: 5),
1344 uint64: Google::Protobuf::UInt64Value.new(value: 6),
1345 bool: Google::Protobuf::BoolValue.new(value: true),
1346 string: Google::Protobuf::StringValue.new(value: "st\nr"),
1347 bytes: Google::Protobuf::BytesValue.new(value: 'fun'),
1374 assert_equal 2.0, m.repeated_double[0].value
1375 assert_equal 4.0, m.repeated_float[0].value
1376 assert_equal 3, m.repeated_int32[0].value
1377 assert_equal 4, m.repeated_int64[0].value
1378 assert_equal 5, m.repeated_uint32[0].value
1379 assert_equal 6, m.repeated_uint64[0].value
1380 assert_equal true, m.repeated_bool[0].value
1381 assert_equal 'str', m.repeated_string[0].value
1382 assert_equal 'fun', m.repeated_bytes[0].value
1386 repeated_double: [Google::Protobuf::DoubleValue.new(value: 2.0)],
1387 repeated_float: [Google::Protobuf::FloatValue.new(value: 4.0)],
1388 repeated_int32: [Google::Protobuf::Int32Value.new(value: 3)],
1389 repeated_int64: [Google::Protobuf::Int64Value.new(value: 4)],
1390 repeated_uint32: [Google::Protobuf::UInt32Value.new(value: 5)],
1391 repeated_uint64: [Google::Protobuf::UInt64Value.new(value: 6)],
1392 repeated_bool: [Google::Protobuf::BoolValue.new(value: true)],
1393 repeated_string: [Google::Protobuf::StringValue.new(value: 'str')],
1394 repeated_bytes: [Google::Protobuf::BytesValue.new(value: 'fun')],
1461 m = klass.new(value: val)
1493 assert_equal Google::Protobuf::DoubleValue.new(value: 4.8), m.double
1496 assert_in_delta Google::Protobuf::FloatValue.new(value: 2.4).value, m.float.value
1499 assert_equal Google::Protobuf::Int32Value.new(value: 5), m.int32
1502 assert_equal Google::Protobuf::Int64Value.new(value: 15), m.int64
1505 assert_equal Google::Protobuf::UInt32Value.new(value: 50), m.uint32
1508 assert_equal Google::Protobuf::UInt64Value.new(value: 500), m.uint64
1511 assert_equal Google::Protobuf::BoolValue.new(value: false), m.bool
1514 assert_equal Google::Protobuf::StringValue.new(value: 'xy'), m.string
1517 assert_equal Google::Protobuf::BytesValue.new(value: '123'), m.bytes
1551 double: Google::Protobuf::DoubleValue.new(value: 2.0),
1552 float: Google::Protobuf::FloatValue.new(value: 4.0),
1553 int32: Google::Protobuf::Int32Value.new(value: 3),
1554 int64: Google::Protobuf::Int64Value.new(value: 4),
1555 uint32: Google::Protobuf::UInt32Value.new(value: 5),
1556 uint64: Google::Protobuf::UInt64Value.new(value: 6),
1557 bool: Google::Protobuf::BoolValue.new(value: true),
1558 string: Google::Protobuf::StringValue.new(value: 'str'),
1559 bytes: Google::Protobuf::BytesValue.new(value: 'fun'),
1572 m.double = Google::Protobuf::DoubleValue.new(value: 4.8)
1574 assert_equal Google::Protobuf::DoubleValue.new(value: 4.8), m.double
1575 m.float = Google::Protobuf::FloatValue.new(value: 2.4)
1577 assert_in_delta Google::Protobuf::FloatValue.new(value: 2.4).value, m.float.value
1578 m.int32 = Google::Protobuf::Int32Value.new(value: 5)
1580 assert_equal Google::Protobuf::Int32Value.new(value: 5), m.int32
1581 m.int64 = Google::Protobuf::Int64Value.new(value: 15)
1583 assert_equal Google::Protobuf::Int64Value.new(value: 15), m.int64
1584 m.uint32 = Google::Protobuf::UInt32Value.new(value: 50)
1586 assert_equal Google::Protobuf::UInt32Value.new(value: 50), m.uint32
1587 m.uint64 = Google::Protobuf::UInt64Value.new(value: 500)
1589 assert_equal Google::Protobuf::UInt64Value.new(value: 500), m.uint64
1590 m.bool = Google::Protobuf::BoolValue.new(value: false)
1592 assert_equal Google::Protobuf::BoolValue.new(value: false), m.bool
1593 m.string = Google::Protobuf::StringValue.new(value: 'xy')
1595 assert_equal Google::Protobuf::StringValue.new(value: 'xy'), m.string
1596 m.bytes = Google::Protobuf::BytesValue.new(value: '123')
1598 assert_equal Google::Protobuf::BytesValue.new(value: '123'), m.bytes
1633 double: Google::Protobuf::DoubleValue.new(value: 2.0),
1634 float: Google::Protobuf::FloatValue.new(value: 4.0),
1635 int32: Google::Protobuf::Int32Value.new(value: 3),
1636 int64: Google::Protobuf::Int64Value.new(value: 4),
1637 uint32: Google::Protobuf::UInt32Value.new(value: 5),
1638 uint64: Google::Protobuf::UInt64Value.new(value: 6),
1639 bool: Google::Protobuf::BoolValue.new(value: true),
1640 string: Google::Protobuf::StringValue.new(value: 'str'),
1641 bytes: Google::Protobuf::BytesValue.new(value: 'fun'),
1662 assert_equal 'you', m.string.value